GATE
Version 3.1-2270

gate
Interface CreoleRegister

All Superinterfaces:
CreoleListener, EventListener, Map, Serializable
All Known Implementing Classes:
CreoleRegisterImpl

public interface CreoleRegister
extends Map, Serializable, CreoleListener

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.

The register is accessible from the static method gate.Gate.getCreoleRegister ; there is only one per application of the GATE framework.

Clients use the register by adding URLs (using the addDirectory method) pointing to CREOLE directories. A CREOLE directory is a URL at which resides a file called creole.xml describing the resources present, and one or more Jar files implementing those resources. E.g., the CREOLE resources at gate.ac.uk are registered by Gate.init() by registering the directory URL http://gate.ac.uk/creole/, under which lives a file called creole.xml.

To register resources clients use the registerDirectories methods. When resources have been registered they can be accessed via their ResourceData objects. So a typical use of the register is to: add the set of URLs containing CREOLE directories; register all resources found at those URLs; browse the set of registered resources.

In all cases, where a resource or a directory is added which is already present in the register, the new silently overwrites the old. The CreoleRegister notifies all registered listeners of all CreoleEvents that occur in the system regardless of whether they were initially fired by the Factory, the DataStoreRegister or the CreoleRegister itself.

See Also:
Gate, ResourceData

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry
 
Method Summary
 void addCreoleListener(CreoleListener l)
          Registers a CreoleListenerwith this CreoleRegister.
 void addDirectory(URL directoryUrl)
          Add a CREOLE directory URL.
 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.
 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.
 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.
 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.
 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 setResourceName(Resource res, String newName)
          Renames an existing resource.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from interface gate.event.CreoleListener
datastoreClosed, datastoreCreated, datastoreOpened, resourceLoaded, resourceRenamed, resourceUnloaded
 

Method Detail

addDirectory

void addDirectory(URL directoryUrl)
Add a CREOLE directory URL. The directory is not registered.


getDirectories

Set getDirectories()
Get the list of CREOLE directory URLs.


registerDirectories

void registerDirectories()
                         throws GateException
Register all the CREOLE directories that we know of. The creole.xml files at the URLs are parsed, and CreoleData objects added to the register.

Throws:
GateException

registerDirectories

void registerDirectories(URL directoryUrl)
                         throws GateException
Register a single CREOLE directory. The 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.

Throws:
GateException

removeDirectory

void removeDirectory(URL directory)
Removes a CREOLE directory from the set of loaded directories.

Parameters:
directory -

registerBuiltins

void registerBuiltins()
                      throws GateException
Register resources that are built in to the GATE distribution. These resources are described by the creole.xml file in resources/creole.

Throws:
GateException

createCreoleDirectoryFile

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. The method concatenates the resource.xml files that the Jars contain.

If Java allowed class methods in interfaces this would be static.


getLrTypes

Set getLrTypes()
Get the list of types of LR in the register.


getPrTypes

Set getPrTypes()
Get the list of types of PR in the register.


getVrTypes

Set getVrTypes()
Get the list of types of VR in the register.


getControllerTypes

Set getControllerTypes()
Get the list of types of VR in the register.


getLrInstances

List getLrInstances()
Get a list of all instantiations of LR in the register.


getPrInstances

List getPrInstances()
Get a list of all instantiations of PR in the register.


getVrInstances

List getVrInstances()
Get a list of all instantiations of VR in the register.


getLrInstances

List getLrInstances(String resourceTypeName)
Get a list of instantiations of a type of LR in the register.


getPrInstances

List getPrInstances(String resourceTypeName)
Get a list of instantiations of a type of PR in the register.


getVrInstances

List getVrInstances(String resourceTypeName)
Get a list of instantiations of a type of VR in the register.


getPublicLrInstances

List getPublicLrInstances()
Get a list of all non-private instantiations of LR in the register.


getPublicPrInstances

List getPublicPrInstances()
Get a list of all non-private instantiations of PR in the register.


getPublicVrInstances

List getPublicVrInstances()
Get a list of all non-private instantiations of VR in the register.


getPublicLrTypes

List getPublicLrTypes()
Get a list of all non-private types of LR in the register.


getPublicPrTypes

List getPublicPrTypes()
Get a list of all non-private types of PR in the register.


getPublicVrTypes

List getPublicVrTypes()
Get a list of all non-private types of VR in the register.


getPublicControllerTypes

List getPublicControllerTypes()
Get a list of all non-private types of Controller in the register.


getAllInstances

List getAllInstances(String type)
                     throws GateException
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"

Throws:
GateException

getLargeVRsForResource

List getLargeVRsForResource(String resourceClassName)
Returns a list of strings representing class names for large VRs valid for a given type of language/processing resource. The default VR will be the first in the returned list.


getSmallVRsForResource

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.


getAnnotationVRs

List getAnnotationVRs()
Returns a list of strings representing class names for annotation VRs that are able to display/edit all types of annotations. The default VR will be the first in the returned list.


getAnnotationVRs

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.


getVREnabledAnnotationTypes

List getVREnabledAnnotationTypes()
Returns a list of strings representing annotations types for which there are custom viewers/editor registered.


setResourceName

void setResourceName(Resource res,
                     String newName)
Renames an existing resource.


addCreoleListener

void addCreoleListener(CreoleListener l)
Registers a CreoleListenerwith 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.


removeCreoleListener

void removeCreoleListener(CreoleListener l)
Removes a CreoleListener previously registered with this CreoleRegister.

See Also:
addCreoleListener(CreoleListener)

GATE
Version 3.1-2270