gate.jape.constraint
Class AnnotationFeatureAccessor

java.lang.Object
  extended by 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

Field Summary
protected  String featureName
           
 
Constructor Summary
AnnotationFeatureAccessor()
           
AnnotationFeatureAccessor(Object key)
           
 
Method Summary
 boolean equals(Object obj)
           
 Object getKey()
          Return the key for this accessor.
 Object getValue(Annotation annot, AnnotationSet context)
          Obtain a named feature
 int hashCode()
           
 void setKey(Object key)
          Store a key or name for the accessor to reference when it attempts to obtain the value of an object.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

featureName

protected String featureName
Constructor Detail

AnnotationFeatureAccessor

public AnnotationFeatureAccessor()

AnnotationFeatureAccessor

public AnnotationFeatureAccessor(Object key)
Method Detail

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: