public class ParsedConstraint extends java.lang.Object implements Constraint
The Constraint
class represents a single data constraint,
including the data type, allowed values, and required ranges.
Constructor and Description |
---|
ParsedConstraint(java.lang.String identifierIn)
This will create a new <code></code> with the specified
identifier as the "name".
|
Modifier and Type | Method and Description |
---|---|
ValidatorError |
checkConstraint(java.lang.Object value)
Check the field against this Constraint to see
if it is in a valid state.
|
boolean |
getASCII()
determines whether the ascii property has been set
|
java.lang.String |
getDataType()
This will return the
String version of the Java data type for this
constraint. |
java.lang.String |
getIdentifier()
This will return the identifier for this
Constraint . |
java.lang.Boolean |
getOptional()
Returns whether the constraint is optional
|
boolean |
getPosix()
Determines whether POSIX flag set
|
boolean |
getUserName()
determines whether the username property has been set
|
boolean |
isPosix(java.lang.String s)
Checks whether a string is a POSIX-compliant username - see
http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_276
for the definition
|
boolean |
isValidUserName(java.lang.String s)
small utility to check whether a string is a valid username.
|
void |
setASCII(boolean flg)
set the ascii property check
|
void |
setDataType(java.lang.String dataTypeIn)
This will allow the data type for the constraint to be set.
|
void |
setOptional(java.lang.Boolean optionalValue)
Sets the optional property
|
void |
setPosix(boolean flag)
Set the posix property check
|
void |
setUserName(boolean flg)
set the username property check
|
java.lang.String |
toString() |
public ParsedConstraint(java.lang.String identifierIn)
This will create a new <code></code> with the specified identifier as the "name".
identifierIn
- String
identifier for Constraint
.public ValidatorError checkConstraint(java.lang.Object value)
checkConstraint
in interface Constraint
value
- the value to checkpublic java.lang.String getIdentifier()
This will return the identifier for this Constraint
.
getIdentifier
in interface Constraint
String
- identifier for this constraint.public void setDataType(java.lang.String dataTypeIn)
This will allow the data type for the constraint to be set. The type is specified
as a Java String
.
setDataType
in interface Constraint
dataTypeIn
- String
that is the Java data type for this constraint.public java.lang.String getDataType()
This will return the String
version of the Java data type for this
constraint.
getDataType
in interface Constraint
String
- the data type for this constraint.public java.lang.String toString()
toString
in class java.lang.Object
public void setASCII(boolean flg)
flg
- boolean for on/off ascii checkpublic boolean getASCII()
public boolean getUserName()
public void setUserName(boolean flg)
flg
- boolean for on/off username checkpublic boolean isValidUserName(java.lang.String s)
s
- string to check for valid usernamepublic boolean isPosix(java.lang.String s)
s
- string to be checkedpublic void setPosix(boolean flag)
flag
- true IFF we should do POSIX validationpublic boolean getPosix()
public void setOptional(java.lang.Boolean optionalValue)
optionalValue
- optional flagpublic java.lang.Boolean getOptional()