use of gate.Gate.ResourceInfo in project gate-core by GateNLP.
the class CreoleAnnotationHandler method createResourceElementsForDirInfo.
/**
* 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.
*
* @param jdomDoc
* JDOM document which should be the parsed creole.xml that this
* handler was configured for.
*/
public void createResourceElementsForDirInfo(Document jdomDoc) throws MalformedURLException {
Element jdomElt = jdomDoc.getRootElement();
// URL directoryUrl = new URL(creoleFileUrl, ".");
// DirectoryInfo dirInfo = Gate.getDirectoryInfo(directoryUrl,jdomDoc);
// if(dirInfo != null) {
Map<String, Element> resourceElements = new HashMap<String, Element>();
findResourceElements(resourceElements, jdomElt);
for (ResourceInfo resInfo : plugin.getResourceInfoList()) {
if (!resourceElements.containsKey(resInfo.getResourceClassName())) {
// no existing RESOURCE element for this resource type (so it
// was
// auto-discovered from a <JAR SCAN="true">), so add a minimal
// RESOURCE element which will be filled in by the annotation
// processor.
jdomElt.addContent(new Element("RESOURCE").addContent(new Element("CLASS").setText(resInfo.getResourceClassName())));
}
}
// }
}
Aggregations