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).
|
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 failpublic Date sanitize(String context, String input)
sanitize
in class BaseValidationRule
Copyright © 2016 The Open Web Application Security Project (OWASP). All rights reserved.