|
GATE Version 3.1-2270 |
|||||||||
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
public class 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 FormNested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry |
Field Summary | |
---|---|
protected Set |
controllerTypes
A list of the types of VR in the register. |
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. |
Constructor Summary | |
---|---|
CreoleRegisterImpl()
Default constructor. |
Method Summary | |
---|---|
void |
addCreoleListener(CreoleListener l)
Registers a CreoleListener with 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. |
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
Constructor Detail |
---|
public CreoleRegisterImpl() throws GateException
GateException
Method Detail |
---|
public void addDirectory(URL directoryUrl)
addDirectory
in interface CreoleRegister
public Set getDirectories()
getDirectories
in interface CreoleRegister
public void registerDirectories() throws GateException
registerDirectories
in interface CreoleRegister
GateException
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
GateException
protected void parseDirectory(InputStream directoryStream, URL directoryUrl, URL creoleFileUrl) throws GateException
GateException
public void registerBuiltins() throws GateException
registerBuiltins
in interface CreoleRegister
GateException
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 void removeDirectory(URL directory)
removeDirectory
in interface CreoleRegister
directory
- 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
GateException
public List getLargeVRsForResource(String resourceClassName)
getLargeVRsForResource
in interface CreoleRegister
resourceClassName
- 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
resourceClassName
- 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 void setResourceName(Resource res, String newName)
setResourceName
in interface CreoleRegister
public List getVREnabledAnnotationTypes()
getVREnabledAnnotationTypes
in interface CreoleRegister
protected List getPublics(List instances)
protected List getPublicTypes(Collection types)
public void removeCreoleListener(CreoleListener l)
CreoleRegister
CreoleListener
previously registered with this
CreoleRegister.
removeCreoleListener
in interface CreoleRegister
CreoleRegister.addCreoleListener(CreoleListener)
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
protected 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)
CreoleListener
Resource
has been loaded into the system
resourceLoaded
in interface CreoleListener
public void resourceUnloaded(CreoleEvent e)
CreoleListener
Resource
has been removed from the system
resourceUnloaded
in interface CreoleListener
public void resourceRenamed(Resource resource, String oldName, String newName)
CreoleListener
resourceRenamed
in interface CreoleListener
public void datastoreOpened(CreoleEvent e)
CreoleListener
DataStore
has been opened
datastoreOpened
in interface CreoleListener
public void datastoreCreated(CreoleEvent e)
CreoleListener
DataStore
has been created
datastoreCreated
in interface CreoleListener
public void datastoreClosed(CreoleEvent e)
CreoleListener
DataStore
has been closed
datastoreClosed
in interface CreoleListener
|
GATE Version 3.1-2270 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |