public class DateValidationRule extends BaseValidationRule
Validator
allowNull, encoder
Constructor and Description |
---|
DateValidationRule(String typeName,
Encoder encoder,
DateFormat newFormat) |
Modifier and Type | Method and Description |
---|---|
Date |
getValid(String context,
String input)
Parse the input, throw exceptions if validation fails
|
Date |
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).
|
Date |
sanitize(String context,
String input,
ValidationErrorList errorList)
Same as sanitize(String, String) except it returns any ValidationException generated in the provided errorList.
|
void |
setDateFormat(DateFormat newFormat) |
assertValid, charArrayToSet, getEncoder, getSafe, getTypeName, getValid, isAllowNull, isValid, setAllowNull, setEncoder, setTypeName, whitelist, whitelist
public DateValidationRule(String typeName, Encoder encoder, DateFormat newFormat)
public final void setDateFormat(DateFormat newFormat)
public Date getValid(String context, String input) throws ValidationException
context
- for logginginput
- the value to be parsedValidationException
- if any validation rules fail, except if the
ESAPI.properties
> property
"Validator.ValidationRule.getValid.ignore509Fix" is set to
true
, which is the default behavior for ESAPI 2.x
releases. See ESAPI GitHub Issues
521
for futher details.ValidationRule.getValid(String context, String input, ValidationErrorList errorList)
public Date sanitize(String context, String input)
sanitize
in class BaseValidationRule
public Date sanitize(String context, String input, ValidationErrorList errorList)
errorList
- The error list to add any ValidationException to.Copyright © 2023 The Open Web Application Security Project (OWASP). All rights reserved.