|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gate.Factory
Provides static methods for the creation of Resources.
Field Summary | |
private static CreoleProxy |
creoleProxy
An object to source events from. |
private static boolean |
DEBUG
Debug flag |
private static DataStoreRegister |
dsReg
The DataStore register |
private static CreoleRegister |
reg
The CREOLE register |
Constructor Summary | |
Factory()
|
Method Summary | |
(package private) static void |
Static initialiser to set up the CreoleProxy event source object |
static void |
addCreoleListener(CreoleListener l)
Add a listener |
static DataStore |
createDataStore(String dataStoreClassName,
URL storageUrl)
Create a new DataStore and open it. |
static Resource |
createResource(String resourceClassName)
Create an instance of a resource using default parameter values. |
static Resource |
createResource(String resourceClassName,
FeatureMap parameterValues)
Create an instance of a resource, and return it. |
static Resource |
createResource(String resourceClassName,
FeatureMap parameterValues,
FeatureMap features)
Create an instance of a resource, and return it. |
static Resource |
createResource(String resourceClassName,
FeatureMap parameterValues,
FeatureMap features,
Map listeners)
Create an instance of a resource, and return it. |
static Resource |
createResource(String resourceClassName,
FeatureMap parameterValues,
Map listeners)
Create an instance of a resource, and return it. |
static void |
deleteResource(Resource resource)
Delete an instance of a resource. |
protected static DataStore |
instantiateDataStore(String dataStoreClassName,
URL storageUrl)
Instantiate a DataStore (not open or created). |
static Corpus |
newCorpus(String name)
Create a new transient Corpus. |
static Document |
newDocument(String content)
Create a new transient textual Document from a string. |
static Document |
newDocument(URL sourceUrl)
Create a new transient Document from a URL. |
static Document |
newDocument(URL sourceUrl,
String encoding)
Create a new transient Document from a URL and an encoding. |
static FeatureMap |
newFeatureMap()
Create a new FeatureMap. |
static DataStore |
openDataStore(String dataStoreClassName,
URL storageUrl)
Open an existing DataStore. |
static void |
removeResourceListeners(Resource resource,
Map listeners)
Removes listeners from a resource. |
static void |
setResourceInittimeParameters(Resource resource,
FeatureMap parameterValues)
For each paramter, set the appropriate property on the resource using bean-style reflection. |
static void |
setResourceListeners(Resource resource,
Map listeners)
Adds listeners to a resource. |
protected static void |
setResourceParameters(Resource resource,
FeatureMap parameterValues)
For each paramter, set the appropriate property on the resource using bean-style reflection. |
static void |
setResourceRuntimeParameters(Resource resource,
FeatureMap parameterValues)
For each paramter, set the appropriate property on the resource using bean-style reflection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
Field Detail |
private static final boolean DEBUG
private static CreoleRegister reg
private static DataStoreRegister dsReg
private static CreoleProxy creoleProxy
Constructor Detail |
public Factory()
Method Detail |
public static Resource createResource(String resourceClassName) throws ResourceInstantiationException
createResource(String,FeatureMap)
public static Resource createResource(String resourceClassName, FeatureMap parameterValues, Map listeners) throws ResourceInstantiationException
resourceClassName
- the name of the class implementing the resource.parameterValues
- the feature map containing intialisation time
parameterValues for the resource.listeners
- The listeners to be registered with the resource during
its initialisation. A Map
that maps from fully
qualified class name (as a string) to listener (of the type declared by
the key).public static Resource createResource(String resourceClassName, FeatureMap parameterValues, FeatureMap features) throws ResourceInstantiationException
resourceClassName
- the name of the class implementing the resource.parameterValues
- the feature map containing intialisation time
parameterValues for the resource.features
- the features for the new resourcepublic static Resource createResource(String resourceClassName, FeatureMap parameterValues, FeatureMap features, Map listeners) throws ResourceInstantiationException
resourceClassName
- the name of the class implementing the resource.parameterValues
- the feature map containing intialisation time
parameterValues for the resource.listeners
- The listeners to be registered with the resource during
its initialisation. A Map
that maps freom fully
qualified class name (as a string) to listener (of the type declared by
the key).features
- the features for the new resourcepublic static Resource createResource(String resourceClassName, FeatureMap parameterValues) throws ResourceInstantiationException
resourceClassName
- the name of the class implementing the resource.parameterValues
- the feature map containing intialisation time
parameterValues for the resource.public static void deleteResource(Resource resource)
resource
- the resource to be deleted.public static void setResourceInittimeParameters(Resource resource, FeatureMap parameterValues) throws ResourceInstantiationException
resource
- the resource to be parameterised.parameterValues
- the parameters and their values.java.beans.Introspector
public static void setResourceRuntimeParameters(Resource resource, FeatureMap parameterValues) throws ResourceInstantiationException
resource
- the resource to be parameterised.parameterValues
- the parameters and their values.java.beans.Introspector
protected static void setResourceParameters(Resource resource, FeatureMap parameterValues) throws ResourceInstantiationException
resource
- the resource to be parameterised.parameterValues
- the parameters and their values.java.beans.Introspector
public static void setResourceListeners(Resource resource, Map listeners) throws IntrospectionException, InvocationTargetException, IllegalAccessException, GateException
listeners
- The listeners to be registered with the resource. A
Map
that maps from fully qualified class name (as a
string) to listener (of the type declared by the key).resource
- the resource that listeners will be registered to.public static void removeResourceListeners(Resource resource, Map listeners) throws IntrospectionException, InvocationTargetException, IllegalAccessException, GateException
listeners
- The listeners to be removed from the resource. A
Map
that maps from fully qualified class name
(as a string) to listener (of the type declared by the key).resource
- the resource that listeners will be removed from.public static Corpus newCorpus(String name) throws ResourceInstantiationException
public static Document newDocument(URL sourceUrl) throws ResourceInstantiationException
public static Document newDocument(URL sourceUrl, String encoding) throws ResourceInstantiationException
public static Document newDocument(String content) throws ResourceInstantiationException
public static FeatureMap newFeatureMap()
public static DataStore openDataStore(String dataStoreClassName, URL storageUrl) throws PersistenceException
public static DataStore createDataStore(String dataStoreClassName, URL storageUrl) throws PersistenceException, UnsupportedOperationException
protected static DataStore instantiateDataStore(String dataStoreClassName, URL storageUrl) throws PersistenceException
public static void addCreoleListener(CreoleListener l)
static void()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |