public class FormatConstraint extends ConstraintObject
FormatConstraint implements
the constraint defined by a pattern that matches the allowed values.
Inside the pattern, each character '*' means any string is valid between
the previous and the following character. The character '?' means
any character is valid at this character position.
Only string entity can be constrained by a format constraint.
The standard way to create a FormatConstraint instance is to use the
method ConstraintObject.createConstraintFromString(String)
with a string representation of a format constraint.
ConstraintObject.MetaCharcompatibilityTable, NO_SUBTYPE, separator, separatorChar, STRING_TYPE_BIG_INTEGER, STRING_TYPE_BOOLEAN, STRING_TYPE_DATE, STRING_TYPE_DECIMAL, STRING_TYPE_ENUMERATED_LIST, STRING_TYPE_FORMAT, STRING_TYPE_INTEGER, STRING_TYPE_LONG, STRING_TYPE_RANGE, STRING_TYPE_STRING, TYPE_BIG_INTEGER, TYPE_BOOLEAN, TYPE_DATE, TYPE_DECIMAL, TYPE_ENUMERATED_LIST, TYPE_FORMAT, TYPE_INTEGER, TYPE_LONG, TYPE_RANGE, TYPE_STRING| Constructor and Description |
|---|
FormatConstraint()
Builds a format constraint.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsMatchingSymbol() |
java.lang.String |
getInitializationString()
Returns the initialization string.
|
java.lang.String |
getPattern()
Returns the pattern of format constraint.
|
boolean |
isBigIntegerConstraint()
Returns big integer status of the format constraint.
|
boolean |
isBooleanConstraint()
Returns boolean status of the format constraint.
|
boolean |
isDateConstraint()
Returns date status of the format constraint.
|
boolean |
isDecimalConstraint()
Returns decimal status of the format constraint.
|
boolean |
isIntegerConstraint()
Returns integer status of the format constraint.
|
boolean |
isLongConstraint()
Returns long status of the format constraint.
|
boolean |
isStringConstraint()
Returns string status of the format constraint.
|
boolean |
isValidValue(java.lang.Object value)
Tests if the value checks the format constraint.
|
void |
setInitializationString(java.lang.String initializationString)
Sets the initialization string.
|
void |
setPattern(java.lang.String pattern)
Sets the pattern of format constraint.
|
java.lang.String |
toString()
Returns
string representation the string that represents the format constraint. |
createConstraintFromString, equals, escapeMetaChar, getAllowedConstraintTypes, getConstraintSubType, getConstraintType, hashCode, isEscapedChar, parseConstraintSubType, unescapeMetaChar, unescapeSeparatorCharpublic java.lang.String getInitializationString()
getInitializationString in class ConstraintObjectpublic void setInitializationString(java.lang.String initializationString)
initializationString - the initialization string.public java.lang.String getPattern()
public void setPattern(java.lang.String pattern)
pattern - the pattern.public boolean isValidValue(java.lang.Object value)
isValidValue in class ConstraintObjectvalue - the value to checktrue if the value checks the format constraint.
false otherwise.public java.lang.String toString()
string representation the string that represents the format constraint.toString in class ConstraintObjectpublic boolean isBooleanConstraint()
isBooleanConstraint in class ConstraintObjectpublic boolean isStringConstraint()
isStringConstraint in class ConstraintObjectpublic boolean isIntegerConstraint()
isIntegerConstraint in class ConstraintObjectpublic boolean isLongConstraint()
isLongConstraint in class ConstraintObjectpublic boolean isBigIntegerConstraint()
isBigIntegerConstraint in class ConstraintObjectpublic boolean isDecimalConstraint()
isDecimalConstraint in class ConstraintObjectpublic boolean isDateConstraint()
isDateConstraint in class ConstraintObjectpublic boolean containsMatchingSymbol()