gate.jape.constraint
Interface AnnotationAccessor

All Superinterfaces:
Serializable
All Known Implementing Classes:
AnnotationFeatureAccessor, CleanStringAccessor, LengthAccessor, MetaPropertyAccessor, SimpleAnnotationAccessor, StringAccessor, TestPR.TestAnnotationAccessor

public interface AnnotationAccessor
extends Serializable

Provides way to access some property of an Annotation or otherwise get a value associated with an annotation (such as the length of text it spans or the text itself if the associated document is available).

Version:
$Revision$
Author:
esword

Method Summary
 Object getKey()
          Return the key for this accessor.
 Object getValue(Annotation annot, AnnotationSet context)
          Obtain the value of some part of the given annotation
 void setKey(Object key)
          Store a key or name for the accessor to reference when it attempts to obtain the value of an object.
 

Method Detail

setKey

void setKey(Object key)
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.

Parameters:
key -

getKey

Object getKey()
Return the key for this accessor.


getValue

Object getValue(Annotation annot,
                AnnotationSet context)
Obtain the value of some part of the given annotation

Parameters:
annot -
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.