it.eng.spago.validation.fieldvalidators
Class DateValidator

java.lang.Object
  extended by it.eng.spago.dispatching.service.DefaultRequestContext
      extended by it.eng.spago.validation.fieldvalidators.AbstractFieldValidator
          extended by it.eng.spago.validation.fieldvalidators.DateValidator
All Implemented Interfaces:
RequestContextIFace, FieldValidatorIFace, java.io.Serializable

public class DateValidator
extends AbstractFieldValidator

Author:
zoppello This class checks if a field is a valid date. This implementation need that this validator should be configured with the a String representing the date format in his configuration in the fieldvalidators.xml For Example: If the config section is not present the format dd/MM/yyyy will be used. This Validator will convert the original value in a java.util.Date if it succeed and this will be putted in TYPED_SERVICE_REQUEST with an alias if this is configured in validation.xml file
See Also:
Serialized Form

Field Summary
static java.lang.String ERRORE_CAMPO_DATA
          The error code used if the validation fails
 
Fields inherited from class it.eng.spago.validation.fieldvalidators.AbstractFieldValidator
DEFAULT_VALUE_IDENTIFIER, GENERIC_ERROR_IDENTIFIER
 
Constructor Summary
DateValidator()
           
 
Method Summary
 void validateField(SourceBean serviceRequest, java.lang.String fieldName, java.lang.String value, java.util.Map fieldValidationParams)
          Implements the logic described in JavaDoc of the class
 
Methods inherited from class it.eng.spago.validation.fieldvalidators.AbstractFieldValidator
getConfig, getParameter, getUserFieldName, init, saveTypedValue, setDefault
 
Methods inherited from class it.eng.spago.dispatching.service.DefaultRequestContext
getErrorHandler, getRequestContainer, getResponseContainer, getServiceRequest, getServiceResponse, setRequestContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERRORE_CAMPO_DATA

public static final java.lang.String ERRORE_CAMPO_DATA
The error code used if the validation fails

See Also:
Constant Field Values
Constructor Detail

DateValidator

public DateValidator()
Method Detail

validateField

public void validateField(SourceBean serviceRequest,
                          java.lang.String fieldName,
                          java.lang.String value,
                          java.util.Map fieldValidationParams)
                   throws EMFValidationError
Implements the logic described in JavaDoc of the class

Parameters:
serviceRequest - Service request
fieldName - Field name
value - Value to validate
fieldValidationParams - Configuration parameters
Throws:
EMFValidationError - Validation error if the value is not valid
See Also:
FieldValidatorIFace.validateField(it.eng.spago.base.SourceBean, java.lang.String, java.lang.String, java.util.Map)