HDIV API 2.0.4

org.hdiv.dataValidator
Class DataValidator

java.lang.Object
  extended by org.hdiv.dataValidator.DataValidator
All Implemented Interfaces:
IDataValidator

public class DataValidator
extends java.lang.Object
implements IDataValidator

It uses an object of type IState and validates all the entry data, besides to replacing the relative values by its real values.

Author:
Roberto Velasco, Oscar Ocariz

Constructor Summary
DataValidator()
           
 
Method Summary
 IState getState()
           
 IValidationResult getValidationResult()
           
 void setConfidentiality(java.lang.Boolean confidentiality)
           
 void setState(IState state)
           
 void setValidationResult(IValidationResult validationResult)
           
 IValidationResult validate(java.lang.String value, java.lang.String target, java.lang.String parameter)
           Checks if the value data sent by the user to the server in the parameter parameter is correct or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataValidator

public DataValidator()
Method Detail

validate

public IValidationResult validate(java.lang.String value,
                                  java.lang.String target,
                                  java.lang.String parameter)

Checks if the value data sent by the user to the server in the parameter parameter is correct or not. The received value is checked with the one stored in the state to decide if it is correct.

In the encoded and hash strategies, the state is obtained from the user request. However, in the memory strategy the state is obtained from the user session, using the state identifier receiced within the request.

Specified by:
validate in interface IDataValidator
Parameters:
value - value sent by the client
target - target action name
parameter - parameter name
Returns:
object that represents the result of the validation process for the parameter parameter and the value data.

getValidationResult

public IValidationResult getValidationResult()

setValidationResult

public void setValidationResult(IValidationResult validationResult)

getState

public IState getState()
Returns:
Returns the validation process state.

setState

public void setState(IState state)
Specified by:
setState in interface IDataValidator
Parameters:
state - The validation process state to set.

setConfidentiality

public void setConfidentiality(java.lang.Boolean confidentiality)
Parameters:
confidentiality - The confidentiality to set.

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.