gate.jape.constraint
Class EmbeddedConstraintPredicate

java.lang.Object
  extended by gate.jape.constraint.AbstractConstraintPredicate
      extended by gate.jape.constraint.EmbeddedConstraintPredicate
All Implemented Interfaces:
ConstraintPredicate, Serializable
Direct Known Subclasses:
ContainsPredicate, WithinPredicate

public abstract class EmbeddedConstraintPredicate
extends AbstractConstraintPredicate

Predicate whose AbstractConstraintPredicate.getValue() property may be set to a Constraint itself, allowing for recursive evaluations.

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

Field Summary
protected  String annotType
           
protected  Constraint valueConstraint
           
 
Fields inherited from class gate.jape.constraint.AbstractConstraintPredicate
accessor, 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
EmbeddedConstraintPredicate()
           
EmbeddedConstraintPredicate(AnnotationAccessor accessor, Object value)
           
 
Method Summary
protected abstract  AnnotationSet doMatch(Annotation annot, AnnotationSet as)
           
 boolean doMatch(Object annotValue, AnnotationSet context)
          Sets up environment for concreate class to do the specific matching check
protected  Collection<Annotation> filterMatches(AnnotationSet containedSet)
          If there are attribute constraints, filter the set.
 void setValue(Object v)
          If the given value is a Constraint, then check if there are any additional attribute/feature-checks on the constraint.
 
Methods inherited from class gate.jape.constraint.AbstractConstraintPredicate
equals, getAccessor, getValue, hashCode, matches, setAccessor, 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

valueConstraint

protected Constraint valueConstraint

annotType

protected String annotType
Constructor Detail

EmbeddedConstraintPredicate

public EmbeddedConstraintPredicate()

EmbeddedConstraintPredicate

public EmbeddedConstraintPredicate(AnnotationAccessor accessor,
                                   Object value)
Method Detail

doMatch

public boolean doMatch(Object annotValue,
                       AnnotationSet context)
                throws JapeException
Sets up environment for concreate class to do the specific matching check

Specified by:
doMatch in class AbstractConstraintPredicate
Throws:
JapeException

doMatch

protected abstract AnnotationSet doMatch(Annotation annot,
                                         AnnotationSet as)

filterMatches

protected Collection<Annotation> filterMatches(AnnotationSet containedSet)
If there are attribute constraints, filter the set.

Parameters:
containedSet -
Returns:

setValue

public void setValue(Object v)
If the given value is a Constraint, then check if there are any additional attribute/feature-checks on the constraint. If so, then store the constraint for use during matching calls. If not, then only the annotation type for the constraint is stored since the full constraint is not needed.

Specified by:
setValue in interface ConstraintPredicate
Overrides:
setValue in class AbstractConstraintPredicate