|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.core.closure.support.AlgorithmsAccessor
org.springframework.rules.constraint.ConstraintsAccessor
org.springframework.rules.Rules
public class Rules
A factory for creating rules.
Constructor Summary | |
---|---|
Rules()
|
|
Rules(Class domainObjectClass)
|
|
Rules(Class domainObjectClass,
Map propertiesConstraints)
|
Method Summary | |
---|---|
void |
add(CompoundConstraint compoundPredicate)
Adds the provided compound predicate, composed of BeanPropertyExpression objects, as a bean property constraint. |
Rules |
add(PropertyConstraint constraint)
Adds the provided bean property expression (constraint) to the list of constraints for the constrained property. |
void |
add(String propertyName,
Constraint valueConstraint)
Adds a value constraint for the specified property. |
void |
add(String propertyName,
Constraint[] valueConstraints)
Adds a value constraint for the specified property. |
void |
addMaxLength(String propertyName,
int maxLength)
|
void |
addMinLength(String propertyName,
int minLength)
|
void |
addRange(String propertyName,
Range range)
|
void |
addRequired(String propertyName)
|
void |
addRequired(String propertyName,
Constraint otherConstraints)
|
void |
afterPropertiesSet()
|
Class |
getDomainObjectType()
|
PropertyConstraint |
getPropertyConstraint(String property)
Returns the constraint on the given property. |
protected void |
initRules()
|
Iterator |
iterator()
|
void |
setDomainObjectType(Class domainObjectType)
|
void |
setPropertiesConstraints(Map propertiesConstraints)
|
boolean |
supports(Class type)
|
boolean |
test(Object bean)
Test the provided argument against this predicate's condition. |
String |
toString()
|
void |
validate(Object bean,
Errors errors)
|
Methods inherited from class org.springframework.rules.constraint.ConstraintsAccessor |
---|
all, all, and, any, any, bind, bind, bind, bind, bind, conjunction, disjunction, eq, eq, eq, eq, eq, eqProperty, eqProperty, getConstraints, gt, gt, gt, gt, gt, gt, gt, gte, gte, gte, gte, gte, gte, gte, gteProperty, gteProperty, gtProperty, gtProperty, ifTrue, ifTrueElse, inGroup, inGroup, inGroup, inRange, inRange, inRangeProperties, inRangeProperties, like, like, lt, lt, lt, lt, lt, lt, lt, lte, lte, lte, lte, lte, lte, lte, lteProperty, lteProperty, ltProperty, ltProperty, maxLength, method, minLength, not, not, or, present, present, range, range, range, range, range, range, range, regexp, regexp, required, required, testResultOf, unique, value |
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, wait, wait, wait |
Constructor Detail |
---|
public Rules()
public Rules(Class domainObjectClass)
public Rules(Class domainObjectClass, Map propertiesConstraints)
Method Detail |
---|
public void setDomainObjectType(Class domainObjectType)
public Class getDomainObjectType()
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
protected void initRules()
public void setPropertiesConstraints(Map propertiesConstraints)
public PropertyConstraint getPropertyConstraint(String property)
PropertyConstraintProvider
getPropertyConstraint
in interface PropertyConstraintProvider
public Iterator iterator()
public Rules add(PropertyConstraint constraint)
constraint
- the bean property expression
public void add(String propertyName, Constraint valueConstraint)
propertyName
- The property name.valueConstraint
- The value constraint.public void add(String propertyName, Constraint[] valueConstraints)
propertyName
- The property name.valueConstraint
- The value constraint.public void addRequired(String propertyName)
public void addRequired(String propertyName, Constraint otherConstraints)
public void addMaxLength(String propertyName, int maxLength)
public void addMinLength(String propertyName, int minLength)
public void addRange(String propertyName, Range range)
public void add(CompoundConstraint compoundPredicate)
compoundPredicate
- public boolean test(Object bean)
Constraint
test
in interface Constraint
bean
- the argument value
true
if the condition was satisfied,
false
otherwisepublic boolean supports(Class type)
supports
in interface Validator
public void validate(Object bean, Errors errors)
validate
in interface Validator
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |