it.eng.spago.validation.fieldvalidators
Class DecimalValidator
java.lang.Object
it.eng.spago.dispatching.service.DefaultRequestContext
it.eng.spago.validation.fieldvalidators.AbstractFieldValidator
it.eng.spago.validation.fieldvalidators.NumericValidator
it.eng.spago.validation.fieldvalidators.DecimalValidator
- All Implemented Interfaces:
- RequestContextIFace, FieldValidatorIFace, java.io.Serializable
public class DecimalValidator
- extends NumericValidator
- Author:
- zoppello
This class checks if a field is a valid decimal number and perform additional checks on
the exact number of decimals after decimal separator and on the maximum number of decimal
after the decimal separator
This implementation need that this validator should be configured with parameters regarding language
and country, with this information the notion of "decimal separator" will depend on Locale object
istantiate using this information
For Example:
If the config section the Italian Locale will be used
This Validator will convert the original value in a java.lang.Double object 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
Method Summary |
void |
handleDecimals(SourceBean serviceRequest,
java.lang.String fieldName,
java.lang.String value,
java.util.Map fieldValidationParams,
char decimalSeparator,
java.util.List params)
Handle optional checks on the decimal part of the number |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ERROR_MAXDECIMALS_IDENTIFIER
public static final java.lang.String ERROR_MAXDECIMALS_IDENTIFIER
- See Also:
- Constant Field Values
ERROR_REQUIRED_DECIMALS_IDENTIFIER
public static final java.lang.String ERROR_REQUIRED_DECIMALS_IDENTIFIER
- See Also:
- Constant Field Values
ERROR_MAX_DECIMALS
public static final java.lang.String ERROR_MAX_DECIMALS
- See Also:
- Constant Field Values
ERROR_REQUIRED_DECIMALS
public static final java.lang.String ERROR_REQUIRED_DECIMALS
- See Also:
- Constant Field Values
DecimalValidator
public DecimalValidator()
handleDecimals
public void handleDecimals(SourceBean serviceRequest,
java.lang.String fieldName,
java.lang.String value,
java.util.Map fieldValidationParams,
char decimalSeparator,
java.util.List params)
throws EMFValidationError
- Description copied from class:
NumericValidator
- Handle optional checks on the decimal part of the number
- Overrides:
handleDecimals
in class NumericValidator
- Throws:
EMFValidationError
- See Also:
FieldValidatorIFace.validateField(it.eng.spago.base.SourceBean, java.lang.String, java.lang.String, java.util.Map)