gate.jape.constraint
Class ConstraintFactory

java.lang.Object
  extended by gate.jape.constraint.ConstraintFactory

public class ConstraintFactory
extends Object

Creates Jape Constraints and associated ConstraintPredicates.

Version:
$Revision$
Author:
esword

Field Summary
protected  Map<String,Class<? extends AnnotationAccessor>> metaPropertyMap
           
protected  Map<String,Class<? extends ConstraintPredicate>> operatorImplMap
           
 
Constructor Summary
ConstraintFactory()
           
 
Method Summary
 void addMetaProperty(String metaProperty, Class<? extends AnnotationAccessor> clazz)
           
 void addOperator(String operator, Class<? extends ConstraintPredicate> clazz)
           
 Constraint createConstraint(String annotType)
          Create a new constraint for the given annotation type
 AnnotationAccessor createDefaultAccessor(Object key)
           
 AnnotationAccessor createMetaPropertyAccessor(String propName)
           
 ConstraintPredicate createPredicate(AnnotationAccessor accessor, Object value)
           
 ConstraintPredicate createPredicate(String operator, AnnotationAccessor accessor, Object value)
           
 ConstraintPredicate createPredicate(String name, Object value)
          Create a constraint predicate using the default equals predicate.
protected  void initMetaPropertyMap()
           
protected  void initOperatorMap()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

operatorImplMap

protected Map<String,Class<? extends ConstraintPredicate>> operatorImplMap

metaPropertyMap

protected Map<String,Class<? extends AnnotationAccessor>> metaPropertyMap
Constructor Detail

ConstraintFactory

public ConstraintFactory()
Method Detail

initOperatorMap

protected void initOperatorMap()

initMetaPropertyMap

protected void initMetaPropertyMap()

addOperator

public void addOperator(String operator,
                        Class<? extends ConstraintPredicate> clazz)

addMetaProperty

public void addMetaProperty(String metaProperty,
                            Class<? extends AnnotationAccessor> clazz)

createConstraint

public Constraint createConstraint(String annotType)
Create a new constraint for the given annotation type

Parameters:
annotType -
Returns:

createDefaultAccessor

public AnnotationAccessor createDefaultAccessor(Object key)

createMetaPropertyAccessor

public AnnotationAccessor createMetaPropertyAccessor(String propName)

createPredicate

public ConstraintPredicate createPredicate(String name,
                                           Object value)
Create a constraint predicate using the default equals predicate.

Parameters:
name - feature name associated with the predicate
value - value associated with the predicate
Returns:

createPredicate

public ConstraintPredicate createPredicate(AnnotationAccessor accessor,
                                           Object value)

createPredicate

public ConstraintPredicate createPredicate(String operator,
                                           AnnotationAccessor accessor,
                                           Object value)