public interface CreoleRegister extends Map<String,ResourceData>, Serializable, CreoleListener
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.
Gate
,
ResourceData
Modifier and Type | Method and Description |
---|---|
void |
addCreoleListener(CreoleListener l)
Registers a
CreoleListener with this CreoleRegister. |
void |
addPluginListener(PluginListener l) |
List<Resource> |
getAllInstances(String type)
Get a list of all the known Resource instances in the register that are of
the specified (class or interface) type or one of its sub-types.
|
List<String> |
getAnnotationVRs()
Returns a list of strings representing class names for annotation VRs
that are able to display/edit all types of annotations.
|
List<String> |
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<String> |
getApplicationTypes()
Get the list of packaged application types in the register.
|
Set<String> |
getControllerTypes()
Get the list of types of VR in the register.
|
Set<URL> |
getDirectories()
Deprecated.
|
List<String> |
getLargeVRsForResource(String resourceClassName)
Returns a list of strings representing class names for large VRs valid
for a given type of language/processing resource.
|
List<LanguageResource> |
getLrInstances()
Get a list of all instantiations of LR in the register.
|
List<LanguageResource> |
getLrInstances(String resourceTypeName)
Get a list of all the known Language Resource instances in the register
whose class is
resourceTypeName . |
Set<String> |
getLrTypes()
Get the list of types of LR in the register.
|
Set<Plugin> |
getPlugins() |
List<ProcessingResource> |
getPrInstances()
Get a list of all instantiations of PR in the register.
|
List<ProcessingResource> |
getPrInstances(String resourceTypeName)
Get a list of all the known Processing Resource instances in the register
whose class is
resourceTypeName . |
Set<String> |
getPrTypes()
Get the list of types of PR in the register.
|
List<String> |
getPublicControllerTypes()
Get a list of all non-private types of Controller in the register.
|
List<LanguageResource> |
getPublicLrInstances()
Get a list of all non-private instantiations of LR in the register.
|
List<String> |
getPublicLrTypes()
Get a list of all non-private types of LR in the register.
|
List<ProcessingResource> |
getPublicPrInstances()
Get a list of all non-private instantiations of PR in the register.
|
List<String> |
getPublicPrTypes()
Get a list of all non-private types of PR in the register.
|
List<VisualResource> |
getPublicVrInstances()
Get a list of all non-private instantiations of VR in the register.
|
List<String> |
getPublicVrTypes()
Get a list of all non-private types of VR in the register.
|
List<String> |
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<String> |
getToolTypes()
Get the list of types of tool in the register.
|
List<String> |
getVREnabledAnnotationTypes()
Returns a list of strings representing annotations types for which
there are custom viewers/editor registered.
|
List<VisualResource> |
getVrInstances()
Get a list of all instantiations of VR in the register.
|
List<VisualResource> |
getVrInstances(String resourceTypeName)
Get a list of all the known Visual Resource instances in the register
whose class is
resourceTypeName . |
Set<String> |
getVrTypes()
Get the list of types of VR in the register.
|
void |
registerBuiltins()
Register resources that are built in to the GATE distribution.
|
void |
registerComponent(Class<? extends Resource> clazz)
Deprecated.
|
void |
registerDirectories(URL directoryUrl)
Deprecated.
|
void |
registerDirectories(URL directoryUrl,
boolean loadDependencies)
Deprecated.
|
void |
registerPlugin(Plugin plugin) |
void |
registerPlugin(Plugin plugin,
boolean loadDependencies) |
void |
removeCreoleListener(CreoleListener l)
Removes a
CreoleListener previously registered with this
CreoleRegister. |
void |
removeDirectory(URL directory)
Deprecated.
|
void |
removePluginListener(PluginListener l) |
void |
setResourceName(Resource res,
String newName)
Renames an existing resource.
|
void |
unregisterPlugin(Plugin plugin) |
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
datastoreClosed, datastoreCreated, datastoreOpened, resourceLoaded, resourceRenamed, resourceUnloaded
@Deprecated Set<URL> getDirectories()
@Deprecated void registerComponent(Class<? extends Resource> clazz) throws GateException
CreoleResource
annotations, register that class as is if it was found in a scanned jar
file with no additional creole.xml information.
This API is intended for use in embedded GATE applications where
the 'application' is created via the API. Components registered with this
API won't work in saved applications, but they can be added
to saved applications at runtime.clazz
- Class object for class with CreoleResource annotations.GateException
@Deprecated 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. If any other plugins that needs to be loaded for this
plugin to load (specified by REQUIRES
elements in
creole.xml
) will also be loaded.GateException
void registerPlugin(Plugin plugin) throws GateException
GateException
void registerPlugin(Plugin plugin, boolean loadDependencies) throws GateException
GateException
@Deprecated void registerDirectories(URL directoryUrl, boolean loadDependencies) 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. If any other
plugins that nees top be loaded for this plugin to load (specified by
REQUIRES
elements in creole.xml
) will only be
loaded if the loadDependencies
param is true. It is useful to
be able to ignore dependencies when loading an xgapp where we know they
have already been resolved.GateException
@Deprecated void removeDirectory(URL directory)
directory
- void unregisterPlugin(Plugin plugin)
void registerBuiltins() throws GateException
GateException
Set<String> getApplicationTypes()
List<LanguageResource> getLrInstances()
List<ProcessingResource> getPrInstances()
List<VisualResource> getVrInstances()
List<LanguageResource> getLrInstances(String resourceTypeName)
resourceTypeName
. This is only direct
instances of the specified class, not its sub-classes, so if
resourceTypeName
refers to an interface or abstract class an
empty list will be returned.List<ProcessingResource> getPrInstances(String resourceTypeName)
resourceTypeName
. This is only direct
instances of the specified class, not its sub-classes, so if
resourceTypeName
refers to an interface or abstract class an
empty list will be returned.List<VisualResource> getVrInstances(String resourceTypeName)
resourceTypeName
. This is only direct
instances of the specified class, not its sub-classes, so if
resourceTypeName
refers to an interface or abstract class an
empty list will be returned.List<LanguageResource> getPublicLrInstances()
List<ProcessingResource> getPublicPrInstances()
List<VisualResource> getPublicVrInstances()
List<String> getPublicLrTypes()
List<String> getPublicPrTypes()
List<String> getPublicVrTypes()
List<String> getPublicControllerTypes()
List<Resource> getAllInstances(String type) throws GateException
r
such that
Gate.getClassLoader().loadClass(type).isInstance(r)Instances that are hidden (
Gate.getHiddenAttribute(r.getFeatures())
== true
) are not included in the returned list.GateException
List<String> getLargeVRsForResource(String resourceClassName)
List<String> getSmallVRsForResource(String resourceClassName)
List<String> getAnnotationVRs()
List<String> getAnnotationVRs(String annotationType)
List<String> getVREnabledAnnotationTypes()
void addCreoleListener(CreoleListener l)
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.void removeCreoleListener(CreoleListener l)
CreoleListener
previously registered with this
CreoleRegister.addCreoleListener(CreoleListener)
void addPluginListener(PluginListener l)
void removePluginListener(PluginListener l)
Copyright © 2024 GATE. All rights reserved.