|
||||||||||
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.constraint.AbstractConstraint
org.springframework.rules.constraint.StringLengthConstraint
public class StringLengthConstraint
Constraint to validate an object's string length.
Constructor Summary | |
---|---|
StringLengthConstraint(int length)
Constructs a maxlength constraint of the specified length. |
|
StringLengthConstraint(int min,
int max)
Constructs a string length range constraint. |
|
StringLengthConstraint(int min,
int max,
String type)
Constructs a string length range constraint. |
|
StringLengthConstraint(int length,
String type)
Constructs a maxlength constraint of the specified length. |
|
StringLengthConstraint(RelationalOperator operator,
int length)
Constructs a string length constraint with the specified operator and length constraint. |
|
StringLengthConstraint(RelationalOperator operator,
int length,
String type)
Constructs a string length constraint with the specified operator and length constraint. |
Method Summary | |
---|---|
Constraint |
getPredicate()
|
String |
getType()
Returns this object's logical type identifier. |
boolean |
test(Object argument)
Tests that the string form of this argument falls within the length constraint. |
String |
toString()
|
Methods inherited from class org.springframework.rules.constraint.AbstractConstraint |
---|
allTrue, allTrue, anyTrue, anyTrue, findAll, findAll, findFirst, findFirst |
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 StringLengthConstraint(int length)
length
- the max string lengthpublic StringLengthConstraint(int length, String type)
length
- the max string lengthpublic StringLengthConstraint(RelationalOperator operator, int length)
operator
- the operator (one of ==, >, >=, <, <=)length
- the length constraintpublic StringLengthConstraint(RelationalOperator operator, int length, String type)
operator
- the operator (one of ==, >, >=, <, <=)length
- the length constrainttype
- Type used to resolve messages.public StringLengthConstraint(int min, int max)
min
- The minimum edge of the rangemax
- the maximum edge of the rangepublic StringLengthConstraint(int min, int max, String type)
min
- The minimum edge of the rangemax
- the maximum edge of the rangeMethod Detail |
---|
public boolean test(Object argument)
test
in interface Constraint
argument
- the argument value
true
if the condition was satisfied,
false
otherwiseConstraint.test(java.lang.Object)
public Constraint getPredicate()
public String toString()
toString
in class Object
public String getType()
TypeResolvable
getType
in interface TypeResolvable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |