## 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 `CreoleEvent`s 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`

Inner classes inherited from class java.util.Map
`Map.Entry`

Method Summary
`void` `addCreoleListener(CreoleListener l)` Registers a `CreoleListener`with 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.

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, resourceUnloaded`

Method Detail

### addDirectory

    public void addDirectory(URL directoryUrl)

  Add a CREOLE directory URL. The directory is not registered.

### getDirectories

    public Set getDirectories()

  Get the list of CREOLE directory URLs.

### registerDirectories

    public 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.

### registerDirectories

    public 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.

### registerBuiltins

    public 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`.

### createCreoleDirectoryFile

    public 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

    public Set getLrTypes()

  Get the list of types of LR in the register.

### getPrTypes

    public Set getPrTypes()

  Get the list of types of PR in the register.

### getVrTypes

    public Set getVrTypes()

  Get the list of types of VR in the register.

### getControllerTypes

    public Set getControllerTypes()

  Get the list of types of VR in the register.

### getLrInstances

    public List getLrInstances()

  Get a list of all instantiations of LR in the register.

### getPrInstances

    public List getPrInstances()

  Get a list of all instantiations of PR in the register.

### getVrInstances

    public List getVrInstances()

  Get a list of all instantiations of VR in the register.

### getLrInstances

    public List getLrInstances(String resourceTypeName)

  Get a list of instantiations of a type of LR in the register.

### getPrInstances

    public List getPrInstances(String resourceTypeName)

  Get a list of instantiations of a type of PR in the register.

### getVrInstances

    public List getVrInstances(String resourceTypeName)

  Get a list of instantiations of a type of VR in the register.

### getPublicLrInstances

    public List getPublicLrInstances()

  Get a list of all non-private instantiations of LR in the register.

### getPublicPrInstances

    public List getPublicPrInstances()

  Get a list of all non-private instantiations of PR in the register.

### getPublicVrInstances

    public List getPublicVrInstances()

  Get a list of all non-private instantiations of VR in the register.

### getPublicLrTypes

    public List getPublicLrTypes()

  Get a list of all non-private types of LR in the register.

### getPublicPrTypes

    public List getPublicPrTypes()

  Get a list of all non-private types of PR in the register.

### getPublicVrTypes

    public List getPublicVrTypes()

  Get a list of all non-private types of VR in the register.

### getPublicControllerTypes

    public List getPublicControllerTypes()

  Get a list of all non-private types of Controller in the register.

### getAllInstances

    public 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"

### getLargeVRsForResource

    public 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

    public 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

    public 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

    public 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

    public List getVREnabledAnnotationTypes()

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

### addCreoleListener

    public void addCreoleListener(CreoleListener l)

  Registers a `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.

### removeCreoleListener

    public void removeCreoleListener(CreoleListener l)

  Removes a `CreoleListener` previously registered with this CreoleRegister. {@see #addCreoleListener()}