public class NumberValidationOperation extends Object
Modifier and Type | Field and Description |
---|---|
protected ValidationExtension |
config |
protected Logger |
logger |
Constructor and Description |
---|
NumberValidationOperation(ValidationExtension config) |
Modifier and Type | Method and Description |
---|---|
protected ValidationContext |
createContext(ValidationOptions options,
MuleEvent muleEvent) |
void |
isNumber(String value,
String locale,
String pattern,
String minValue,
String maxValue,
NumberType numberType,
ValidationOptions options,
MuleEvent event)
Receives a numeric
value as a String and validates that it can be parsed
per the rules of a numberType |
protected void |
logSuccessfulValidation(Validator validator,
MuleEvent event) |
protected Locale |
parseLocale(String locale) |
protected void |
validateWith(Validator validator,
ValidationContext validationContext,
MuleEvent event) |
protected final Logger logger
protected final ValidationExtension config
public NumberValidationOperation(ValidationExtension config)
@Operation public void isNumber(String value, @Optional String locale, @Optional String pattern, @Optional String minValue, @Optional String maxValue, NumberType numberType, @ParameterGroup ValidationOptions options, MuleEvent event) throws Exception
value
as a String
and validates that it can be parsed
per the rules of a numberType
value
- the value to be testedlocale
- The locale to use for the format. If not provided it defaults to the system Locale
pattern
- The pattern used to format the valueminValue
- If provided, check that the parsed value is greater or equal than this valuemaxValue
- If provided, check that the parsed value is less or equal than this valuenumberType
- the type of number to test value
againstoptions
- the ValidationOptions
event
- the current MuleEvent
Exception
protected void validateWith(Validator validator, ValidationContext validationContext, MuleEvent event) throws Exception
Exception
protected ValidationContext createContext(ValidationOptions options, MuleEvent muleEvent)
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.