|
GATE Version 3.1-2270 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgate.util.AbstractFeatureBearer
gate.creole.AbstractResource
public abstract class AbstractResource
A convenience implementation of Resource with some default code.
Field Summary | |
---|---|
protected String |
name
|
Fields inherited from class gate.util.AbstractFeatureBearer |
---|
features |
Constructor Summary | |
---|---|
AbstractResource()
|
Method Summary | |
---|---|
static boolean |
checkParameterValues(Resource resource,
List parameters)
Checks whether the provided Resource has values for all the
required parameters from the provided list of parameters. |
void |
cleanup()
releases the memory allocated to this resource |
static BeanInfo |
getBeanInfo(Class c)
|
String |
getName()
Returns the name of this resource |
static Object |
getParameterValue(Resource resource,
String paramaterName)
Gets the value of a parameter for a resource. |
Object |
getParameterValue(String paramaterName)
Gets the value of a parameter of this resource. |
Resource |
init()
Initialise this resource, and return it. |
static void |
removeResourceListeners(Resource resource,
Map listeners)
Removes listeners from a resource. |
void |
setName(String name)
Sets the name of this resource |
static void |
setParameterValue(Resource resource,
BeanInfo resBeanInf,
String paramaterName,
Object parameterValue)
Sets the value for a specified parameter for a resource. |
void |
setParameterValue(String paramaterName,
Object parameterValue)
Sets the value for a specified parameter for this resource. |
void |
setParameterValues(FeatureMap parameters)
Sets the values for more parameters for this resource in one step. |
static void |
setParameterValues(Resource resource,
FeatureMap parameters)
Sets the values for more parameters for a resource in one step. |
static void |
setResourceListeners(Resource resource,
Map listeners)
Adds listeners to a resource. |
Methods inherited from class gate.util.AbstractFeatureBearer |
---|
getFeatures, setFeatures |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface gate.util.FeatureBearer |
---|
getFeatures, setFeatures |
Field Detail |
---|
protected String name
Constructor Detail |
---|
public AbstractResource()
Method Detail |
---|
public Resource init() throws ResourceInstantiationException
init
in interface Resource
ResourceInstantiationException
public void setName(String name)
setName
in interface NameBearer
public String getName()
getName
in interface NameBearer
public void cleanup()
cleanup
in interface Resource
public static Object getParameterValue(Resource resource, String paramaterName) throws ResourceInstantiationException
resource
- the resource from which the parameter value will be
obtainedparamaterName
- the name of the parameter
ResourceInstantiationException
public static void setParameterValue(Resource resource, BeanInfo resBeanInf, String paramaterName, Object parameterValue) throws ResourceInstantiationException
resource
- the resource for which the parameter value will be setparamaterName
- the name for the parameterparameterValue
- the value the parameter will receive
ResourceInstantiationException
public static void setParameterValues(Resource resource, FeatureMap parameters) throws ResourceInstantiationException
parameters
- a feature map that has paramete names as keys and
parameter values as values.
ResourceInstantiationException
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.
IntrospectionException
InvocationTargetException
IllegalAccessException
GateException
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.
IntrospectionException
InvocationTargetException
IllegalAccessException
GateException
public static boolean checkParameterValues(Resource resource, List parameters) throws ResourceInstantiationException
Resource
has values for all the
required parameters from the provided list of parameters.
resource
- the resource being checkedparameters
- is a List
of List
of Parameter
representing a list of parameter disjunctions (e.g. the one returned by
ParameterList.getRuntimeParameters()
).
{@link
- ResourceInstantiationException} if problems occur while
inspecting the parameters for the resource. These will normally be
introspection problems and are usually caused by the lack of a parameter
or of the read accessor for a parameter.
ResourceInstantiationException
public Object getParameterValue(String paramaterName) throws ResourceInstantiationException
getParameterValue
in interface Resource
paramaterName
- the name of the parameter
ResourceInstantiationException
public void setParameterValue(String paramaterName, Object parameterValue) throws ResourceInstantiationException
setParameterValue
in interface Resource
paramaterName
- the name for the parameterparameterValue
- the value the parameter will receive
ResourceInstantiationException
public void setParameterValues(FeatureMap parameters) throws ResourceInstantiationException
setParameterValues
in interface Resource
parameters
- a feature map that has paramete names as keys and
parameter values as values.
ResourceInstantiationException
public static BeanInfo getBeanInfo(Class c) throws IntrospectionException
IntrospectionException
|
GATE Version 3.1-2270 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |