|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
gate.creole.CreoleRegisterImpl
This class implements the CREOLE register interface. DO NOT construct objects of this class unless your name is gate.Gate (in which case please go back to the source code repository and stop looking at other class's code).
The CREOLE register records the set of resources that are currently
known to the system. Each member of the register is a
ResourceData object, indexed by
the class name of the resource.
CreoleRegister,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class java.util.HashMap |
|
| Nested classes inherited from class java.util.AbstractMap |
|
| Nested classes inherited from class java.util.Map |
Map.Entry |
| Field Summary | |
protected Set |
controllerTypes
A list of the types of VR in the register. |
private Vector |
creoleListeners
|
protected static boolean |
DEBUG
Debug flag |
protected Set |
directories
The set of CREOLE directories (URLs). |
protected Set |
lrTypes
A list of the types of LR in the register. |
protected SAXParser |
parser
The parser for the CREOLE directory files |
protected Set |
prTypes
A list of the types of PR in the register. |
protected Set |
toolTypes
A list of the types of TOOL in the register. |
protected List |
vrTypes
A list of the types of VR in the register. |
| Fields inherited from class java.util.HashMap |
|
| Fields inherited from class java.util.AbstractMap |
|
| Constructor Summary | |
CreoleRegisterImpl()
Default constructor. |
|
| Method Summary | |
void |
addCreoleListener(CreoleListener l)
Registers a CreoleListenerwith this CreoleRegister.
|
void |
addDirectory(URL directoryUrl)
Deprecated. |
void |
clear()
Overide HashMap's clear to update the list of LR types in the register, and remove all resources and forgets all directories. |
File |
createCreoleDirectoryFile(File directoryFile,
Set jarFileNames)
This is a utility method for creating CREOLE directory files (typically called creole.xml) from a list of Jar
files that contain resources. |
void |
datastoreClosed(CreoleEvent e)
Called when a DataStore has been closed |
void |
datastoreCreated(CreoleEvent e)
Called when a DataStore has been created |
void |
datastoreOpened(CreoleEvent e)
Called when a DataStore has been opened |
protected void |
fireDatastoreClosed(CreoleEvent e)
|
protected void |
fireDatastoreCreated(CreoleEvent e)
|
protected void |
fireDatastoreOpened(CreoleEvent e)
|
protected void |
fireResourceLoaded(CreoleEvent e)
|
protected void |
fireResourceRenamed(Resource res,
String oldName,
String newName)
|
protected void |
fireResourceUnloaded(CreoleEvent e)
|
List |
getAllInstances(String type)
Gets all the instantiations of a given type and all its derivate types; It doesn't return instances that have the hidden attribute set to "true" |
List |
getAnnotationVRs()
Returns a list of strings representing class names for annotation VRs that are able to display/edit all types of annotations. |
List |
getAnnotationVRs(String annotationType)
Returns a list of strings representing class names for annotation VRs that are able to display/edit a given annotation type The default VR will be the first in the returned list. |
Set |
getControllerTypes()
Get the list of types of VR in the register. |
Set |
getDirectories()
Get the list of CREOLE directory URLs. |
List |
getLargeVRsForResource(String resourceClassName)
Returns a list of strings representing class names for large VRs valid for a given type of language/processing resource. |
List |
getLrInstances()
Get a list of all instantiations of LR in the register. |
List |
getLrInstances(String resourceTypeName)
Get a list of instantiations of a type of LR in the register. |
Set |
getLrTypes()
Get the list of types of LR in the register. |
List |
getPrInstances()
Get a list of all instantiations of PR in the register. |
List |
getPrInstances(String resourceTypeName)
Get a list of instantiations of a type of PR in the register. |
Set |
getPrTypes()
Get the list of types of PR in the register. |
List |
getPublicControllerTypes()
Get a list of all non-private types of controller in the register. |
List |
getPublicLrInstances()
Get a list of all non-private instantiations of LR in the register. |
List |
getPublicLrTypes()
Get a list of all non-private types of LR in the register. |
List |
getPublicPrInstances()
Get a list of all non-private instantiations of PR in the register. |
List |
getPublicPrTypes()
Get a list of all non-private types of PR in the register. |
protected List |
getPublics(List instances)
Get a list of all non-private instantiations. |
protected List |
getPublicTypes(Collection types)
Gets a list of all non private types from alist of types |
List |
getPublicVrInstances()
Get a list of all non-private instantiations of VR in the register. |
List |
getPublicVrTypes()
Get a list of all non-private types of VR in the register. |
List |
getSmallVRsForResource(String resourceClassName)
Returns a list of strings representing class names for small VRs valid for a given type of language/processing resource The default VR will be the first in the returned list. |
Set |
getToolTypes()
Get the list of types of TOOL respurces in the register. |
List |
getVREnabledAnnotationTypes()
Returns a list of strings representing annotations types for which there are custom viewers/editor registered. |
List |
getVrInstances()
Get a list of all instantiations of VR in the register. |
List |
getVrInstances(String resourceTypeName)
Get a list of instantiations of a type of VR in the register. |
private List |
getVRsForResource(String resourceClassName,
int guiType)
Returns a list of strings representing class names for guiType VRs valid for a given type of language/processing resource The default VR will be the first in the returned list. |
Set |
getVrTypes()
Get the list of types of VR in the register. |
protected void |
parseDirectory(InputStream directoryStream,
URL directoryUrl,
URL creoleFileUrl)
Parse a directory file (represented as an open stream), adding resource data objects to the CREOLE register as they occur. |
Object |
put(Object key,
Object value)
Overide HashMap's put method to maintain a list of all the types of LR in the register, and a list of tool types. |
void |
registerBuiltins()
Register resources that are built in to the GATE distribution. |
void |
registerDirectories()
Deprecated. |
void |
registerDirectories(URL directoryUrl)
Register a single CREOLE directory. |
Object |
remove(Object key)
Overide HashMap's delete method to update the lists of types in the register. |
void |
removeCreoleListener(CreoleListener l)
Removes a CreoleListener previously registered with this
CreoleRegister. |
void |
removeDirectory(URL directory)
Removes a CREOLE directory from the set of loaded directories. |
void |
resourceLoaded(CreoleEvent e)
Called when a new Resource has been loaded into the system |
void |
resourceRenamed(Resource resource,
String oldName,
String newName)
Called when the creole register has renamed a resource.1 |
void |
resourceUnloaded(CreoleEvent e)
Called when a Resource has been removed from the system |
void |
setResourceName(Resource res,
String newName)
Renames an existing resource. |
| Methods inherited from class java.util.HashMap |
clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, putAll, size, values |
| Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, size, values |
| Field Detail |
protected static final boolean DEBUG
protected Set directories
protected transient SAXParser parser
protected Set lrTypes
protected Set prTypes
protected List vrTypes
protected Set controllerTypes
protected Set toolTypes
private transient Vector creoleListeners
| Constructor Detail |
public CreoleRegisterImpl()
throws GateException
| Method Detail |
public void addDirectory(URL directoryUrl)
addDirectory in interface CreoleRegisterpublic Set getDirectories()
getDirectories in interface CreoleRegister
public void registerDirectories()
throws GateException
registerDirectories in interface CreoleRegisterGateException
public void registerDirectories(URL directoryUrl)
throws GateException
creole.xml
file at the URL is parsed, and CreoleData objects added
to the register. If the directory URL has not yet been added it
is now added.
URLs for resource JAR files are added to the GATE class loader.
registerDirectories in interface CreoleRegisterGateException
protected void parseDirectory(InputStream directoryStream,
URL directoryUrl,
URL creoleFileUrl)
throws GateException
GateException
public void registerBuiltins()
throws GateException
registerBuiltins in interface CreoleRegisterGateException
public File createCreoleDirectoryFile(File directoryFile,
Set jarFileNames)
creole.xml) from a list of Jar
files that contain resources. The method concatenates the
resource.xml files that the Jars contain.
If Java allowed class methods in interfaces this would be static.
createCreoleDirectoryFile in interface CreoleRegister
public Object put(Object key,
Object value)
put in interface Mappublic void removeDirectory(URL directory)
removeDirectory in interface CreoleRegisterdirectory - public Object remove(Object key)
remove in interface Mappublic void clear()
clear in interface Mappublic Set getLrTypes()
getLrTypes in interface CreoleRegisterpublic Set getPrTypes()
getPrTypes in interface CreoleRegisterpublic Set getVrTypes()
getVrTypes in interface CreoleRegisterpublic Set getControllerTypes()
getControllerTypes in interface CreoleRegisterpublic Set getToolTypes()
public List getLrInstances()
getLrInstances in interface CreoleRegisterpublic List getPrInstances()
getPrInstances in interface CreoleRegisterpublic List getVrInstances()
getVrInstances in interface CreoleRegisterpublic List getLrInstances(String resourceTypeName)
getLrInstances in interface CreoleRegisterpublic List getPrInstances(String resourceTypeName)
getPrInstances in interface CreoleRegisterpublic List getVrInstances(String resourceTypeName)
getVrInstances in interface CreoleRegisterpublic List getPublicLrInstances()
getPublicLrInstances in interface CreoleRegisterpublic List getPublicPrInstances()
getPublicPrInstances in interface CreoleRegisterpublic List getPublicVrInstances()
getPublicVrInstances in interface CreoleRegisterpublic List getPublicLrTypes()
getPublicLrTypes in interface CreoleRegisterpublic List getPublicPrTypes()
getPublicPrTypes in interface CreoleRegisterpublic List getPublicVrTypes()
getPublicVrTypes in interface CreoleRegisterpublic List getPublicControllerTypes()
getPublicControllerTypes in interface CreoleRegister
public List getAllInstances(String type)
throws GateException
getAllInstances in interface CreoleRegisterGateExceptionpublic List getLargeVRsForResource(String resourceClassName)
getLargeVRsForResource in interface CreoleRegisterresourceClassName - the name of the resource that has large viewers. If
resourceClassName is null then an empty list will be returned.
public List getSmallVRsForResource(String resourceClassName)
getSmallVRsForResource in interface CreoleRegisterresourceClassName - the name of the resource that has large viewers. If
resourceClassName is null then an empty list will be returned.
private List getVRsForResource(String resourceClassName,
int guiType)
resourceClassName - the name of the resource that has large viewers. If
resourceClassName is null then an empty list will be returned.guiType - can be ResourceData's LARGE_GUI or SMALL_GUI
public List getAnnotationVRs()
getAnnotationVRs in interface CreoleRegisterpublic List getAnnotationVRs(String annotationType)
getAnnotationVRs in interface CreoleRegister
public void setResourceName(Resource res,
String newName)
setResourceName in interface CreoleRegisterpublic List getVREnabledAnnotationTypes()
getVREnabledAnnotationTypes in interface CreoleRegisterprotected List getPublics(List instances)
protected List getPublicTypes(Collection types)
public void removeCreoleListener(CreoleListener l)
CreoleRegisterCreoleListener previously registered with this
CreoleRegister.
removeCreoleListener in interface CreoleRegisterCreoleRegister.addCreoleListener(CreoleListener)public void addCreoleListener(CreoleListener l)
CreoleRegisterCreoleListenerwith this CreoleRegister.
The register will fire events every time a resource is added to or removed
from the system and when a datastore is created, opened or closed.
addCreoleListener in interface CreoleRegisterprotected void fireResourceLoaded(CreoleEvent e)
protected void fireResourceUnloaded(CreoleEvent e)
protected void fireResourceRenamed(Resource res,
String oldName,
String newName)
protected void fireDatastoreOpened(CreoleEvent e)
protected void fireDatastoreCreated(CreoleEvent e)
protected void fireDatastoreClosed(CreoleEvent e)
public void resourceLoaded(CreoleEvent e)
CreoleListenerResource has been loaded into the system
resourceLoaded in interface CreoleListenerpublic void resourceUnloaded(CreoleEvent e)
CreoleListenerResource has been removed from the system
resourceUnloaded in interface CreoleListener
public void resourceRenamed(Resource resource,
String oldName,
String newName)
CreoleListener
resourceRenamed in interface CreoleListenerpublic void datastoreOpened(CreoleEvent e)
CreoleListenerDataStore has been opened
datastoreOpened in interface CreoleListenerpublic void datastoreCreated(CreoleEvent e)
CreoleListenerDataStore has been created
datastoreCreated in interface CreoleListenerpublic void datastoreClosed(CreoleEvent e)
CreoleListenerDataStore has been closed
datastoreClosed in interface CreoleListener
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||