gate.jape.constraint
Class LengthAccessor

java.lang.Object
  extended by gate.jape.constraint.MetaPropertyAccessor
      extended by gate.jape.constraint.LengthAccessor
All Implemented Interfaces:
AnnotationAccessor, Serializable

public class LengthAccessor
extends MetaPropertyAccessor

Accessor that returns the length of the characters spanned by the annotation

Version:
$Revision$
Author:
esword
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gate.jape.constraint.MetaPropertyAccessor
log
 
Constructor Summary
LengthAccessor()
           
 
Method Summary
 Object getKey()
          Always returns "length", the name of the meta-property which this accessor provides.
 Object getValue(Annotation annot, AnnotationSet context)
          Return the length of the span of the annotation.
 
Methods inherited from class gate.jape.constraint.MetaPropertyAccessor
equals, hashCode, setKey, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LengthAccessor

public LengthAccessor()
Method Detail

getValue

public Object getValue(Annotation annot,
                       AnnotationSet context)
Return the length of the span of the annotation.

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.

getKey

public Object getKey()
Always returns "length", the name of the meta-property which this accessor provides.

Specified by:
getKey in interface AnnotationAccessor
Specified by:
getKey in class MetaPropertyAccessor