|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.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 FormInner classes inherited from class java.util.Map |
Map.Entry |
Constructor Summary | |
CreoleRegisterImpl()
Default constructor. |
Method Summary | |
void |
addCreoleListener(CreoleListener l)
Registers a CreoleListener with this CreoleRegister. |
void |
addDirectory(URL directoryUrl)
Add a CREOLE directory URL to the register and to the GATE classloader. |
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 |
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. |
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. |
Set |
getVrTypes()
Get the list of types of VR in the register. |
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()
Register all the CREOLE directories that we know of. |
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 |
resourceLoaded(CreoleEvent e)
Called when a new Resource has been loaded into the system |
void |
resourceUnloaded(CreoleEvent e)
Called when a Resource has been removed from the system |
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 |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, size, values |
Constructor Detail |
public CreoleRegisterImpl() throws GateException
Method Detail |
public void addDirectory(URL directoryUrl)
addDirectory
in interface CreoleRegister
public Set getDirectories()
getDirectories
in interface CreoleRegister
public void registerDirectories() throws GateException
creole.xml
files
at the URLs are parsed, and ResourceData
objects added
to the register.
URLs for resource JAR files are added to the GATE class loader.registerDirectories
in interface CreoleRegister
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 CreoleRegister
public void registerBuiltins() throws GateException
registerBuiltins
in interface CreoleRegister
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 Map
put
in class HashMap
public Object remove(Object key)
remove
in interface Map
remove
in class HashMap
public void clear()
clear
in interface Map
clear
in class HashMap
public Set getLrTypes()
getLrTypes
in interface CreoleRegister
public Set getPrTypes()
getPrTypes
in interface CreoleRegister
public Set getVrTypes()
getVrTypes
in interface CreoleRegister
public Set getControllerTypes()
getControllerTypes
in interface CreoleRegister
public Set getToolTypes()
public List getLrInstances()
getLrInstances
in interface CreoleRegister
public List getPrInstances()
getPrInstances
in interface CreoleRegister
public List getVrInstances()
getVrInstances
in interface CreoleRegister
public List getLrInstances(String resourceTypeName)
getLrInstances
in interface CreoleRegister
public List getPrInstances(String resourceTypeName)
getPrInstances
in interface CreoleRegister
public List getVrInstances(String resourceTypeName)
getVrInstances
in interface CreoleRegister
public List getPublicLrInstances()
getPublicLrInstances
in interface CreoleRegister
public List getPublicPrInstances()
getPublicPrInstances
in interface CreoleRegister
public List getPublicVrInstances()
getPublicVrInstances
in interface CreoleRegister
public List getPublicLrTypes()
getPublicLrTypes
in interface CreoleRegister
public List getPublicPrTypes()
getPublicPrTypes
in interface CreoleRegister
public List getPublicVrTypes()
getPublicVrTypes
in interface CreoleRegister
public List getPublicControllerTypes()
getPublicControllerTypes
in interface CreoleRegister
public List getAllInstances(String type) throws GateException
getAllInstances
in interface CreoleRegister
public List getLargeVRsForResource(String resourceClassName)
getLargeVRsForResource
in interface CreoleRegister
resoureClassName
- 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 CreoleRegister
resoureClassName
- the name of the resource that has large viewers. If
resourceClassName is null then an empty list will be returned.public List getAnnotationVRs()
getAnnotationVRs
in interface CreoleRegister
public List getAnnotationVRs(String annotationType)
getAnnotationVRs
in interface CreoleRegister
public List getVREnabledAnnotationTypes()
getVREnabledAnnotationTypes
in interface CreoleRegister
public void removeCreoleListener(CreoleListener l)
CreoleRegister
CreoleListener
previously registered with this
CreoleRegister. {@see #addCreoleListener()}removeCreoleListener
in interface CreoleRegister
public void addCreoleListener(CreoleListener l)
CreoleRegister
CreoleListener
with 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 CreoleRegister
public void resourceLoaded(CreoleEvent e)
CreoleListener
Resource
has been loaded into the systemresourceLoaded
in interface CreoleListener
public void resourceUnloaded(CreoleEvent e)
CreoleListener
Resource
has been removed from the systemresourceUnloaded
in interface CreoleListener
public void datastoreOpened(CreoleEvent e)
CreoleListener
DataStore
has been openeddatastoreOpened
in interface CreoleListener
public void datastoreCreated(CreoleEvent e)
CreoleListener
DataStore
has been createddatastoreCreated
in interface CreoleListener
public void datastoreClosed(CreoleEvent e)
CreoleListener
DataStore
has been closeddatastoreClosed
in interface CreoleListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |