org.springframework.rules.constraint
Class ConstraintsAccessor

java.lang.Object
  extended by org.springframework.core.closure.support.AlgorithmsAccessor
      extended by org.springframework.rules.constraint.ConstraintsAccessor
Direct Known Subclasses:
AbstractBinaryConstraint, AbstractConstraint, DefaultRulesSource, Rules

public class ConstraintsAccessor
extends AlgorithmsAccessor

A convenience constraints factory accessor for easy subclassing.

Author:
Keith Donald

Constructor Summary
ConstraintsAccessor()
           
 
Method Summary
 Constraint all(Constraint[] predicates)
           
 PropertyConstraint all(String propertyName, Constraint[] constraints)
           
 Constraint and(Constraint constraint1, Constraint constraint2)
           
 Constraint any(Constraint[] constraints)
           
 PropertyConstraint any(String propertyName, Constraint[] constraints)
           
 Constraint bind(BinaryConstraint constraint, boolean parameter)
           
 Constraint bind(BinaryConstraint constraint, double parameter)
           
 Constraint bind(BinaryConstraint constraint, float parameter)
           
 Constraint bind(BinaryConstraint constraint, int parameter)
           
 Constraint bind(BinaryConstraint constraint, Object parameter)
           
 And conjunction()
           
 Or disjunction()
           
 Constraint eq(int value)
           
 Constraint eq(Object value)
           
 Constraint eq(Object value, Comparator comparator)
           
 PropertyConstraint eq(String propertyName, Object propertyValue)
           
 PropertyConstraint eq(String propertyName, Object propertyValue, Comparator comparator)
           
 PropertyConstraint eqProperty(String propertyName, String otherPropertyName)
           
 PropertyConstraint eqProperty(String propertyName, String otherPropertyName, Comparator comparator)
           
protected  Constraints getConstraints()
           
 Constraint gt(Comparable value)
           
 Constraint gt(double value)
           
 Constraint gt(float value)
           
 Constraint gt(int value)
           
 Constraint gt(long value)
           
 Constraint gt(Object value, Comparator comparator)
           
 PropertyConstraint gt(String propertyName, Comparable propertyValue)
           
 Constraint gte(Comparable value)
           
 Constraint gte(double value)
           
 Constraint gte(float value)
           
 Constraint gte(int value)
           
 Constraint gte(long value)
           
 Constraint gte(Object value, Comparator comparator)
           
 PropertyConstraint gte(String propertyName, Comparable propertyValue)
           
 PropertyConstraint gteProperty(String propertyName, String otherPropertyName)
           
 PropertyConstraint gteProperty(String propertyName, String otherPropertyName, Comparator comparator)
           
 PropertyConstraint gtProperty(String propertyName, String otherPropertyName)
           
 PropertyConstraint gtProperty(String propertyName, String otherPropertyName, Comparator comparator)
           
 Constraint ifTrue(Constraint constraint, Constraint mustAlsoBeTrue)
           
 Constraint ifTrueElse(Constraint constraint, Constraint mustAlsoBeTrue, Constraint elseMustAlsoBeTrue)
           
 Constraint inGroup(Object[] group)
           
 Constraint inGroup(Set group)
           
 PropertyConstraint inGroup(String propertyName, Object[] group)
           
 PropertyConstraint inRange(String propertyName, Comparable min, Comparable max)
           
 PropertyConstraint inRange(String propertyName, Comparable min, Comparable max, Comparator comparator)
           
 PropertyConstraint inRangeProperties(String propertyName, String minPropertyName, String maxPropertyName)
           
 PropertyConstraint inRangeProperties(String propertyName, String minPropertyName, String maxPropertyName, Comparator comparator)
           
 Constraint like(String encodedLikeString)
           
 PropertyConstraint like(String property, Like.LikeType likeType, String value)
           
 Constraint lt(Comparable value)
           
 Constraint lt(Comparable value, Comparator comparator)
           
 Constraint lt(double value)
           
 Constraint lt(float value)
           
 Constraint lt(int value)
           
 Constraint lt(long value)
           
 PropertyConstraint lt(String propertyName, Comparable propertyValue)
           
 Constraint lte(Comparable value)
           
 Constraint lte(double value)
           
 Constraint lte(float value)
           
 Constraint lte(int value)
           
 Constraint lte(long value)
           
 Constraint lte(Object value, Comparator comparator)
           
 PropertyConstraint lte(String propertyName, Comparable propertyValue)
           
 PropertyConstraint lteProperty(String propertyName, String otherPropertyName)
           
 PropertyConstraint lteProperty(String propertyName, String otherPropertyName, Comparator comparator)
           
 PropertyConstraint ltProperty(String propertyName, String otherPropertyName)
           
 PropertyConstraint ltProperty(String propertyName, String otherPropertyName, Comparator comparator)
           
 Constraint maxLength(int maxLength)
           
 Constraint method(Object target, String methodName, String constraintType)
           
 Constraint minLength(int minLength)
           
 Constraint not(Constraint constraint)
           
 PropertyConstraint not(PropertyConstraint constraint)
           
 Constraint or(Constraint constraint1, Constraint constraint2)
           
 Constraint present()
           
 PropertyConstraint present(String property)
           
 Constraint range(Comparable min, Comparable max)
           
 Constraint range(Comparable min, Comparable max, boolean inclusive)
           
 Constraint range(float min, float max)
           
 Constraint range(int min, int max)
           
 Constraint range(long min, long max)
           
 Constraint range(Object min, Object max, Comparator comparator)
           
 Constraint range(Object min, Object max, Comparator comparator, boolean inclusive)
           
 Constraint regexp(String regexp)
           
 Constraint regexp(String regexp, String constraintType)
           
 Constraint required()
           
 PropertyConstraint required(String property)
           
 Constraint testResultOf(Closure closure, Constraint constraint)
           
 PropertyConstraint unique(String propertyName)
           
 PropertyConstraint value(String propertyName, Constraint valueConstraint)
           
 
Methods inherited from class org.springframework.core.closure.support.AlgorithmsAccessor
allTrue, allTrue, anyTrue, anyTrue, findAll, findAll, findFirst, findFirst, forEach, forEach, getAlgorithms
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstraintsAccessor

public ConstraintsAccessor()
Method Detail

getConstraints

protected Constraints getConstraints()

bind

public Constraint bind(BinaryConstraint constraint,
                       Object parameter)

bind

public Constraint bind(BinaryConstraint constraint,
                       int parameter)

bind

public Constraint bind(BinaryConstraint constraint,
                       float parameter)

bind

public Constraint bind(BinaryConstraint constraint,
                       double parameter)

bind

public Constraint bind(BinaryConstraint constraint,
                       boolean parameter)

testResultOf

public Constraint testResultOf(Closure closure,
                               Constraint constraint)

eq

public Constraint eq(Object value)

eq

public Constraint eq(int value)

eq

public Constraint eq(Object value,
                     Comparator comparator)

gt

public Constraint gt(Comparable value)

gt

public Constraint gt(Object value,
                     Comparator comparator)

gt

public Constraint gt(int value)

gt

public Constraint gt(long value)

gt

public Constraint gt(float value)

gt

public Constraint gt(double value)

gte

public Constraint gte(Comparable value)

gte

public Constraint gte(Object value,
                      Comparator comparator)

gte

public Constraint gte(int value)

gte

public Constraint gte(long value)

gte

public Constraint gte(float value)

gte

public Constraint gte(double value)

lt

public Constraint lt(Comparable value)

lt

public Constraint lt(Comparable value,
                     Comparator comparator)

lt

public Constraint lt(int value)

lt

public Constraint lt(long value)

lt

public Constraint lt(float value)

lt

public Constraint lt(double value)

lte

public Constraint lte(Comparable value)

lte

public Constraint lte(Object value,
                      Comparator comparator)

lte

public Constraint lte(int value)

lte

public Constraint lte(long value)

lte

public Constraint lte(float value)

lte

public Constraint lte(double value)

range

public Constraint range(Comparable min,
                        Comparable max)

range

public Constraint range(Comparable min,
                        Comparable max,
                        boolean inclusive)

range

public Constraint range(Object min,
                        Object max,
                        Comparator comparator)

range

public Constraint range(Object min,
                        Object max,
                        Comparator comparator,
                        boolean inclusive)

range

public Constraint range(int min,
                        int max)

range

public Constraint range(long min,
                        long max)

range

public Constraint range(float min,
                        float max)

present

public Constraint present()

present

public PropertyConstraint present(String property)

ifTrue

public Constraint ifTrue(Constraint constraint,
                         Constraint mustAlsoBeTrue)

ifTrueElse

public Constraint ifTrueElse(Constraint constraint,
                             Constraint mustAlsoBeTrue,
                             Constraint elseMustAlsoBeTrue)

and

public Constraint and(Constraint constraint1,
                      Constraint constraint2)

all

public Constraint all(Constraint[] predicates)

conjunction

public And conjunction()

or

public Constraint or(Constraint constraint1,
                     Constraint constraint2)

any

public Constraint any(Constraint[] constraints)

not

public Constraint not(Constraint constraint)

disjunction

public Or disjunction()

inGroup

public Constraint inGroup(Set group)

inGroup

public Constraint inGroup(Object[] group)

inGroup

public PropertyConstraint inGroup(String propertyName,
                                  Object[] group)

like

public Constraint like(String encodedLikeString)

like

public PropertyConstraint like(String property,
                               Like.LikeType likeType,
                               String value)

required

public Constraint required()

required

public PropertyConstraint required(String property)

maxLength

public Constraint maxLength(int maxLength)

minLength

public Constraint minLength(int minLength)

regexp

public Constraint regexp(String regexp)

regexp

public Constraint regexp(String regexp,
                         String constraintType)

method

public Constraint method(Object target,
                         String methodName,
                         String constraintType)

value

public PropertyConstraint value(String propertyName,
                                Constraint valueConstraint)

all

public PropertyConstraint all(String propertyName,
                              Constraint[] constraints)

any

public PropertyConstraint any(String propertyName,
                              Constraint[] constraints)

not

public PropertyConstraint not(PropertyConstraint constraint)

eq

public PropertyConstraint eq(String propertyName,
                             Object propertyValue)

eq

public PropertyConstraint eq(String propertyName,
                             Object propertyValue,
                             Comparator comparator)
Since:
0.3.0

gt

public PropertyConstraint gt(String propertyName,
                             Comparable propertyValue)

gte

public PropertyConstraint gte(String propertyName,
                              Comparable propertyValue)

lt

public PropertyConstraint lt(String propertyName,
                             Comparable propertyValue)

lte

public PropertyConstraint lte(String propertyName,
                              Comparable propertyValue)

eqProperty

public PropertyConstraint eqProperty(String propertyName,
                                     String otherPropertyName,
                                     Comparator comparator)
Since:
0.3.0

gtProperty

public PropertyConstraint gtProperty(String propertyName,
                                     String otherPropertyName,
                                     Comparator comparator)
Since:
0.3.0

gteProperty

public PropertyConstraint gteProperty(String propertyName,
                                      String otherPropertyName,
                                      Comparator comparator)
Since:
0.3.0

ltProperty

public PropertyConstraint ltProperty(String propertyName,
                                     String otherPropertyName,
                                     Comparator comparator)
Since:
0.3.0

lteProperty

public PropertyConstraint lteProperty(String propertyName,
                                      String otherPropertyName,
                                      Comparator comparator)
Since:
0.3.0

inRange

public PropertyConstraint inRange(String propertyName,
                                  Comparable min,
                                  Comparable max,
                                  Comparator comparator)
Since:
0.3.0

inRangeProperties

public PropertyConstraint inRangeProperties(String propertyName,
                                            String minPropertyName,
                                            String maxPropertyName,
                                            Comparator comparator)
Since:
0.3.0

eqProperty

public PropertyConstraint eqProperty(String propertyName,
                                     String otherPropertyName)

gtProperty

public PropertyConstraint gtProperty(String propertyName,
                                     String otherPropertyName)

gteProperty

public PropertyConstraint gteProperty(String propertyName,
                                      String otherPropertyName)

ltProperty

public PropertyConstraint ltProperty(String propertyName,
                                     String otherPropertyName)

lteProperty

public PropertyConstraint lteProperty(String propertyName,
                                      String otherPropertyName)

inRange

public PropertyConstraint inRange(String propertyName,
                                  Comparable min,
                                  Comparable max)

inRangeProperties

public PropertyConstraint inRangeProperties(String propertyName,
                                            String minPropertyName,
                                            String maxPropertyName)

unique

public PropertyConstraint unique(String propertyName)


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.