public class NumberValidationRule extends BaseValidationRule
Validator
allowNull, encoder
Constructor and Description |
---|
NumberValidationRule(String typeName,
Encoder encoder) |
NumberValidationRule(String typeName,
Encoder encoder,
double minValue,
double maxValue) |
Modifier and Type | Method and Description |
---|---|
Double |
getValid(String context,
String input)
Parse the input, throw exceptions if validation fails
|
Double |
sanitize(String context,
String input)
The method is similar to ValidationRuile.getSafe except that it returns a
harmless object that may or may not have any similarity to the original
input (in some cases you may not care).
|
assertValid, charArrayToSet, getEncoder, getSafe, getTypeName, getValid, isAllowNull, isValid, setAllowNull, setEncoder, setTypeName, whitelist, whitelist
public Double getValid(String context, String input) throws ValidationException
context
- for logginginput
- the value to be parsedValidationException
- Thrown if any validation rules fail, except when the
ESAPI.properties
> property
"Validator.HtmlValidationAction" is set to
clean
. The default ESAPI.properties
> property file
has "Validator.HtmlValidationAction" is set to throw
, which results
in a ValidationException
being thrown if any of the validation rules
fail.
releases. See ESAPI GitHub Issues
521
for futher details.ValidationRule.getValid(String context, String input, ValidationErrorList errorList)
public Double sanitize(String context, String input)
sanitize
in class BaseValidationRule
Copyright © 2023 The Open Worldwide Application Security Project (OWASP). All rights reserved.