public class StringConstraints extends Object implements Constraints
Modifier and Type | Field and Description |
---|---|
protected String |
illegalERE |
protected StringSet |
illegalValues |
protected String |
legalERE |
protected StringSet |
legalValues |
protected String |
max |
protected String |
min |
Constructor and Description |
---|
StringConstraints()
Default constructor.
|
StringConstraints(String min,
String max,
String legalValues,
String illegalValues,
String legalERE,
String illegalERE)
Creates a string constraints enforcement entity.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isValid(Serializable o)
Determines whether or not the given object is valid in the context of
these constraints.
|
protected String min
protected String max
protected String legalERE
protected String illegalERE
protected StringSet legalValues
protected StringSet illegalValues
public StringConstraints()
public StringConstraints(String min, String max, String legalValues, String illegalValues, String legalERE, String illegalERE)
min
- If not null, it specifies the minimum lexicographical value
the parsed argument can have to be a valid parameter.max
- If not null, it specifies the maximum lexicographical value
the parsed argument can have to be a valid parameter.legalValues
- A string-set token, listing all legal values that
the parsed argument can take on. The values in the set are separated
via the pipe (|) character and abbreviated values can be specified
using the asterisk (*) character.illegalValues
- A string-set token, listing all illegal values that
the parsed argument cannot take on. The values in the set are separated
via the pipe (|) character and abbreviated values can be specified
using the asterisk (*) character.legalERE
- Regular expression which the parameter must match,
or null.illegalERE
- Regular expression which the parameter must not match,
or null.public boolean isValid(Serializable o)
Constraints
isValid
in interface Constraints
o
- object to be validated against the constraintsConstraints.isValid(java.io.Serializable)
Copyright © 2015. All Rights Reserved.