gate.jape.constraint
Class AnnotationFeatureAccessor
java.lang.Object
gate.jape.constraint.AnnotationFeatureAccessor
- All Implemented Interfaces:
- AnnotationAccessor, Serializable
public class AnnotationFeatureAccessor
- extends Object
- implements AnnotationAccessor
Accessor that returns a named feature value.
- Version:
- $Revision$
- Author:
- esword
- See Also:
- Serialized Form
featureName
protected String featureName
AnnotationFeatureAccessor
public AnnotationFeatureAccessor()
AnnotationFeatureAccessor
public AnnotationFeatureAccessor(Object key)
getValue
public Object getValue(Annotation annot,
AnnotationSet context)
- Obtain a named feature
- Specified by:
getValue in interface AnnotationAccessor
context - optional parameter with information about the
context in which the annotation has meaning. Normally this
would be a Document. Not all accessors will
require the context information so it may be null. Some
accessor implementations may throw an exception without
it.
- Returns:
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
toString
public String toString()
- Overrides:
toString in class Object
setKey
public void setKey(Object key)
- Description copied from interface:
AnnotationAccessor
- Store a key or name for the accessor to reference when it attempts
to obtain the value of an object. Different implementors will have
different uses for the key. For example, it could be the name of
the feature that should be returned. It could also be the name of a
property to invoke on the Annotation object.
- Specified by:
setKey in interface AnnotationAccessor
getKey
public Object getKey()
- Description copied from interface:
AnnotationAccessor
- Return the key for this accessor.
- Specified by:
getKey in interface AnnotationAccessor
- Returns: