gate.creole
Class CreoleAnnotationHandler

java.lang.Object
  extended by gate.creole.CreoleAnnotationHandler

public class CreoleAnnotationHandler
extends Object

Class to take a creole.xml file (as a JDOM tree) and add elements corresponding to the CREOLE annotations on the RESOURCE classes it declares.


Constructor Summary
CreoleAnnotationHandler(URL creoleFileUrl)
          Create an annotation handler for the given creole.xml file.
 
Method Summary
 void addJarsToClassLoader(org.jdom.Document jdomDoc)
          Extract all JAR elements from the given JDOM document and add the jars they reference to the GateClassLoader.
 void createResourceElementsForDirInfo(org.jdom.Document jdomDoc)
          Fetches the directory information for this handler's creole plugin and adds additional RESOURCE elements to the given JDOM document so that it contains a RESOURCE for every resource type defined in the plugin's directory info.
 void processAnnotations(org.jdom.Document jdomDoc)
          Processes annotations for resource classes named in the given creole.xml document, adding the relevant XML elements to the document as appropriate.
 void processCreoleResourceAnnotations(org.jdom.Element element, Class<?> resourceClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreoleAnnotationHandler

public CreoleAnnotationHandler(URL creoleFileUrl)
Create an annotation handler for the given creole.xml file.

Parameters:
creoleFileUrl - location of the creole.xml file.
Method Detail

addJarsToClassLoader

public void addJarsToClassLoader(org.jdom.Document jdomDoc)
                          throws IOException
Extract all JAR elements from the given JDOM document and add the jars they reference to the GateClassLoader.

Parameters:
jdomDoc - JDOM document representing a parsed creole.xml file.
Throws:
IOException

createResourceElementsForDirInfo

public void createResourceElementsForDirInfo(org.jdom.Document jdomDoc)
                                      throws MalformedURLException
Fetches the directory information for this handler's creole plugin and adds additional RESOURCE elements to the given JDOM document so that it contains a RESOURCE for every resource type defined in the plugin's directory info.

Parameters:
jdomDoc - JDOM document which should be the parsed creole.xml that this handler was configured for.
Throws:
MalformedURLException

processAnnotations

public void processAnnotations(org.jdom.Document jdomDoc)
                        throws GateException
Processes annotations for resource classes named in the given creole.xml document, adding the relevant XML elements to the document as appropriate.

Parameters:
jdomDoc - the parsed creole.xml file
Throws:
GateException

processCreoleResourceAnnotations

public void processCreoleResourceAnnotations(org.jdom.Element element,
                                             Class<?> resourceClass)
                                      throws GateException
Throws:
GateException