it.eng.spago.validation.fieldvalidators
Class AlphaNumericValidator

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.AlphaNumericValidator
All Implemented Interfaces:
RequestContextIFace, FieldValidatorIFace, java.io.Serializable

public class AlphaNumericValidator
extends AbstractFieldValidator

Author:
zoppello This class checks if a field is an alfanumeric String, in this Spago default implemenation of spago, an Alphanumeric String is composed of number and literal characters, exclude special characted, like point, question point ect.... This implementation is based on the regular expression "^([a-zA-Z0-9\\s])*$" to check if the field is AplhaNumeric This Validator doesn't apply type conversion, if it succed the original value will be put 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_ALFANUMERICO
          The error code if this validator fails
 
Fields inherited from class it.eng.spago.validation.fieldvalidators.AbstractFieldValidator
DEFAULT_VALUE_IDENTIFIER, GENERIC_ERROR_IDENTIFIER
 
Constructor Summary
AlphaNumericValidator()
           
 
Method Summary
 void validateField(SourceBean serviceRequest, java.lang.String fieldName, java.lang.String value, java.util.Map fieldValidationParams)
          See Javadoc for class description
 
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_ALFANUMERICO

public static final java.lang.String ERRORE_CAMPO_ALFANUMERICO
The error code if this validator fails

See Also:
Constant Field Values
Constructor Detail

AlphaNumericValidator

public AlphaNumericValidator()
Method Detail

validateField

public void validateField(SourceBean serviceRequest,
                          java.lang.String fieldName,
                          java.lang.String value,
                          java.util.Map fieldValidationParams)
                   throws EMFValidationError
See Javadoc for class description

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)