HDIV API 2.0.4

org.hdiv.dataValidator
Interface IDataValidator

All Known Implementing Classes:
DataValidator

public interface IDataValidator

Interface to validate the data sent by the user.

Author:
Roberto Velasco, Oscar Ocariz

Method Summary
 void setState(IState state)
           
 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.
 

Method Detail

validate

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.

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.

setState

void setState(IState state)
Parameters:
state - The validation process state to set.

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.