Changeset 8542
- Timestamp:
- 2004-11-12T16:50:25+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/doctypes/RecogniserManager.java
r8493 r8542 24 24 * Add a recogniser to this manager 25 25 */ 26 public void addRecogniser(String documentType) 27 { ClassLoader loader = ClassLoader.getSystemClassLoader(); 28 java.lang.Class thisClass = null; 29 try { 30 thisClass = loader.loadClass("org.greenstone.gsdl3.gs3build.doctypes." + documentType + "Recogniser"); 26 public RecogniserInterface addRecogniser(String documentType) 27 { 28 ClassLoader loader = ClassLoader.getSystemClassLoader(); 29 java.lang.Class thisClass = null; 30 try { 31 thisClass = loader.loadClass("org.greenstone.gsdl3.gs3build.doctypes." + documentType + "Recogniser"); 32 Object instance = thisClass.newInstance(); 33 this.addRecogniser((RecogniserInterface) instance); 34 return (RecogniserInterface)instance; 35 } 36 catch (ClassNotFoundException ex) { 37 System.err.println(ex); 38 return null; 39 } 40 catch (InstantiationException instEx) { 41 System.err.println(instEx); 42 } 43 catch (IllegalAccessException accEx) { 44 System.err.println(accEx); 45 } 46 return null; 31 47 } 32 catch (ClassNotFoundException ex) { 33 System.err.println(ex); 34 } 35 36 try { 37 Object instance = thisClass.newInstance(); 38 this.addRecogniser((RecogniserInterface) instance); 39 } 40 catch (InstantiationException instEx) { 41 System.err.println(instEx); 42 } 43 catch (IllegalAccessException accEx) { 44 System.err.println(accEx); 45 } 46 } 47 48 48 49 /** 49 50 *
Note:
See TracChangeset
for help on using the changeset viewer.