public class HTMLValidationRule extends StringValidationRule
Validator
blacklistPatterns, maxLength, minLength, validateInputAndCanonical, whitelistPatterns
allowNull, encoder
Constructor and Description |
---|
HTMLValidationRule(String typeName) |
HTMLValidationRule(String typeName,
Encoder encoder) |
HTMLValidationRule(String typeName,
Encoder encoder,
String whitelistPattern) |
Modifier and Type | Method and Description |
---|---|
String |
getValid(String context,
String input)
Parse the input, throw exceptions if validation fails
|
String |
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).
|
addBlacklistPattern, addBlacklistPattern, addWhitelistPattern, addWhitelistPattern, setMaximumLength, setMinimumLength, setValidateInputAndCanonical
assertValid, charArrayToSet, getEncoder, getSafe, getTypeName, getValid, isAllowNull, isValid, setAllowNull, setEncoder, setTypeName, whitelist, whitelist
public HTMLValidationRule(String typeName)
public String getValid(String context, String input) throws ValidationException
getValid
in interface ValidationRule
getValid
in class StringValidationRule
context
- for logginginput
- the value to be parsedValidationException
- if any validation rules failpublic String sanitize(String context, String input)
sanitize
in class StringValidationRule
Copyright © 2016 The Open Web Application Security Project (OWASP). All rights reserved.