|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.inigoserrano.isvalidator.data.SimpleData
This class is the base of all the Data, it isn´t specialized in any domain. The rest of the Data usually overrides the methods that need and uses this class´s
| Field Summary | |
protected java.util.Vector |
almacen
the store of all the Checks |
protected ErrorDo |
constraintListener
One errorDo that listen the parameters |
protected ErrorDoGroup |
constraintListenerContainer
the group of errorDo that listen the parameters |
protected boolean |
hasBeenChecked
if the data has been checked |
protected boolean |
match
if the data match all the constraints |
protected boolean |
throwException
if we must throw an exception, this flag is at container level |
protected OkDo |
validConstraintProcesor
The OkDo to process this data |
protected java.lang.String |
valueToCheck
the data to check |
protected java.lang.String |
valueToCheckName
the name of the data (parameterName, argumentName,...) |
| Constructor Summary | |
SimpleData(java.lang.String valueToCheck)
This is the most simple constructor, only with the data to check |
|
SimpleData(java.lang.String valueToCheck,
boolean throwException)
Constructor that indicates the dat to check and explicity if throw exception if dosen´t match |
|
SimpleData(java.lang.String valueToCheck,
java.lang.String valueToCheckName)
Constructor, with the data and its name |
|
SimpleData(java.lang.String valueToCheck,
java.lang.String valueToCheckName,
boolean throwException)
Constructor, with the data, its name and if throw an exception |
|
| Method Summary | |
void |
addCheck(SimpleCheck constraint)
Add one constraint to the store, it also notifies to the constraint that this object is its container. |
void |
addDataParameters(ErrorDo listener)
This method add the constraintContainer´s parameters when the data is invalid. |
boolean |
check()
This method gets all the constraints and check if the data match all this constraints. |
java.lang.String |
executeOkDo(OkDo constraintListener)
This method set the ValidConstrinatProcessor and executes it. |
ErrorDoGroup |
getErrorDoGroup()
This method returns a container with instances of invalidConstraintProcessors, one for each constraint that dosen´t match. |
OkDo |
getOkDo()
Returns the ValidConstraintProcessor |
java.lang.String |
getValueToCheck()
Return the data to check [Spanish] Devuelve el valor a comprobar, este método es llamado por la restricción para saber que valor debe comprobar. |
java.lang.String |
getValueToCheckName()
Return the name of the data to check [Spanish] Devuelve el nombre del valor a comprobar, por ejemplo el nombre del parametro del servlet. |
boolean |
isChecked()
Return if this data has been checked |
boolean |
isTrownException()
Return if throw an Exception if this constraintContainer dose´nt match some constraint |
boolean |
match()
Return if this data match or not (the value return by checkConstraints) |
boolean |
needExecutedCheck(java.lang.String constraintName)
This method is used by the consstraint to indicate to the container that needs one diferent constraint executed, if the container hasn´t then return false else returns true. |
void |
setErrorDo(ErrorDo constraintListener,
ErrorDoGroup constraintListenerContainer)
This method puts the InValidConstraintProcesor and InValidConstraintProcesorContainer |
void |
setOkDo(OkDo constraintListener)
This method puts the OkDo |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Vector almacen
protected java.lang.String valueToCheck
protected boolean throwException
protected ErrorDoGroup constraintListenerContainer
protected ErrorDo constraintListener
protected OkDo validConstraintProcesor
protected boolean match
protected boolean hasBeenChecked
protected java.lang.String valueToCheckName
| Constructor Detail |
public SimpleData(java.lang.String valueToCheck)
valueToCheck - the data that has to be checked
public SimpleData(java.lang.String valueToCheck,
java.lang.String valueToCheckName)
valueToCheck - the data to checkvalueToCheckName - the name of the data (for example the name of
the parameter of the servlet or the argument of the commandLine)
public SimpleData(java.lang.String valueToCheck,
java.lang.String valueToCheckName,
boolean throwException)
valueToCheck - the data to checkvalueToCheckName - the name of the data (for example the name of
the parameter of the servlet or the argument of the commandLine)throwException - true if must throw an exception when the data
dosn´t fit the constraints
public SimpleData(java.lang.String valueToCheck,
boolean throwException)
valueToCheck - the data to checkthrowException - true if throw an exception when the data
dosen´t match the constraints| Method Detail |
public void addCheck(SimpleCheck constraint)
throws InternalCheckException
addCheck in interface Dataconstraint - the constraint to add
InternalCheckException - for internal errorspublic void addDataParameters(ErrorDo listener)
addDataParameters in interface DataInternallistener - the object that receives the parameters
public boolean check()
throws CheckException,
InternalCheckException
check in interface CheckCheckException - Throws if the data dosn´t match and the flag
is on
InternalCheckException - for internal error only
public java.lang.String executeOkDo(OkDo constraintListener)
throws OkDoInternalException
executeOkDo in interface DataconstraintListener - the validConstraintProcesor object
to handle the process
OkDoInternalException - for internal error onlypublic ErrorDoGroup getErrorDoGroup()
getErrorDoGroup in interface Datapublic OkDo getOkDo()
getOkDo in interface Datapublic java.lang.String getValueToCheck()
getValueToCheck in interface Datapublic java.lang.String getValueToCheckName()
getValueToCheckName in interface Datapublic boolean isChecked()
isChecked in interface Checkpublic boolean isTrownException()
isTrownException in interface DataInternalpublic boolean match()
match in interface Check
public boolean needExecutedCheck(java.lang.String constraintName)
throws CheckException,
InternalCheckException
needExecutedCheck in interface DataInternalconstraintName - the class name of the constraint that needs
(com.inigoserrano.isvalidator.checks.NotBlankCheck, for example)
CheckException - Throw if the data dosn´t match and the flag is on
InternalCheckException - For internal error only
public void setErrorDo(ErrorDo constraintListener,
ErrorDoGroup constraintListenerContainer)
setErrorDo in interface DataconstraintListener - One instance of an InValidConstraintProcesorconstraintListenerContainer - One instance
of an InValidConstraintProcesorContainerpublic void setOkDo(OkDo constraintListener)
setOkDo in interface DataconstraintListener - The OkDo
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||