gate.jape.constraint
Class AbstractConstraintPredicate

java.lang.Object
  extended by gate.jape.constraint.AbstractConstraintPredicate
All Implemented Interfaces:
ConstraintPredicate, Serializable
Direct Known Subclasses:
AbstractRegExpPredicate, ComparablePredicate, EmbeddedConstraintPredicate, EqualPredicate, TestPR.TestConstraintPredicate

public abstract class AbstractConstraintPredicate
extends Object
implements ConstraintPredicate

Base class for most ConstraintPredicates. Contains standard getters/setters and other routines.

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

Field Summary
protected  AnnotationAccessor accessor
           
protected  Object value
           
 
Fields inherited from interface gate.jape.constraint.ConstraintPredicate
EQUAL, GREATER, GREATER_OR_EQUAL, LESSER, LESSER_OR_EQUAL, NOT_EQUAL, NOT_REGEXP_FIND, NOT_REGEXP_MATCH, REGEXP_FIND, REGEXP_MATCH
 
Constructor Summary
AbstractConstraintPredicate()
           
AbstractConstraintPredicate(AnnotationAccessor accessor, Object value)
           
 
Method Summary
protected abstract  boolean doMatch(Object value, AnnotationSet context)
           
 boolean equals(Object obj)
           
 AnnotationAccessor getAccessor()
          The accessor associated with this predicate.
 Object getValue()
          The value used in comparisons against passed in data in ConstraintPredicate.matches(Annotation, AnnotationSet).
 int hashCode()
           
 boolean matches(Annotation annot, AnnotationSet context)
          Evaluates if the provided annotation meets the requirements of the predicate.
 void setAccessor(AnnotationAccessor accessor)
          Set the accessor associated with this predicate.
 void setValue(Object value)
          Set the value used in comparisons against passed in data in ConstraintPredicate.matches(Annotation, AnnotationSet).
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gate.jape.constraint.ConstraintPredicate
getOperator
 

Field Detail

accessor

protected AnnotationAccessor accessor

value

protected Object value
Constructor Detail

AbstractConstraintPredicate

public AbstractConstraintPredicate()

AbstractConstraintPredicate

public AbstractConstraintPredicate(AnnotationAccessor accessor,
                                   Object value)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

matches

public boolean matches(Annotation annot,
                       AnnotationSet context)
                throws JapeException
Description copied from interface: ConstraintPredicate
Evaluates if the provided annotation meets the requirements of the predicate.

Specified by:
matches in interface ConstraintPredicate
Throws:
JapeException

doMatch

protected abstract boolean doMatch(Object value,
                                   AnnotationSet context)
                            throws JapeException
Throws:
JapeException

setAccessor

public void setAccessor(AnnotationAccessor accessor)
Description copied from interface: ConstraintPredicate
Set the accessor associated with this predicate.

Specified by:
setAccessor in interface ConstraintPredicate

getAccessor

public AnnotationAccessor getAccessor()
Description copied from interface: ConstraintPredicate
The accessor associated with this predicate.

Specified by:
getAccessor in interface ConstraintPredicate

setValue

public void setValue(Object value)
Description copied from interface: ConstraintPredicate
Set the value used in comparisons against passed in data in ConstraintPredicate.matches(Annotation, AnnotationSet).

Specified by:
setValue in interface ConstraintPredicate

getValue

public Object getValue()
Description copied from interface: ConstraintPredicate
The value used in comparisons against passed in data in ConstraintPredicate.matches(Annotation, AnnotationSet).

Specified by:
getValue in interface ConstraintPredicate