public class IdentityValidationUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
IdentityValidationUtil.ValidatorPattern
Defines a predefined set of pattern list
|
| Constructor and Description |
|---|
IdentityValidationUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addPattern(String key,
String regex)
Adds a validation pattern and stores it against the provided key.
|
static String |
getValidInput(String input,
String[] whiteListPatterns,
String[] blackListPatterns)
Returns the input if valid over the given white list and black list patterns else throws an
IdentityValidationException
|
static String |
getValidInputOverBlackListPatterns(String input,
String... blackListPatterns)
Returns the input if valid over the given black list patterns else throws an IdentityValidationException
|
static String |
getValidInputOverWhiteListPatterns(String input,
String... whiteListPatterns)
Returns the input if valid over the given white list patterns else throws an IdentityValidationException
|
static boolean |
isValid(String input,
String[] whiteListPatterns,
String[] blackListPatterns)
Validates the provided input against the given white list and black list patterns.
|
static boolean |
isValidOverBlackListPatterns(String input,
String... blackListPatterns)
Validates the provided input against the given black list patterns
|
static boolean |
isValidOverWhiteListPatterns(String input,
String... whiteListPatterns)
Validates the provided input against the given white list patterns
|
static boolean |
patternExists(String key)
Checks if a pattern exists for the provided key
|
static void |
removePattern(String key)
Removes a validation pattern
|
public static boolean isValidOverWhiteListPatterns(String input, String... whiteListPatterns)
input - inputwhiteListPatterns - a String array of white list pattern keyspublic static boolean isValidOverBlackListPatterns(String input, String... blackListPatterns)
input - inputblackListPatterns - a String array of black list pattern keyspublic static boolean isValid(String input, String[] whiteListPatterns, String[] blackListPatterns)
input - inputwhiteListPatterns - a String array of white list pattern keysblackListPatterns - a String array of black list pattern keyspublic static String getValidInputOverWhiteListPatterns(String input, String... whiteListPatterns) throws IdentityValidationException
input - inputwhiteListPatterns - a String array of white list pattern keysIdentityValidationExceptionpublic static String getValidInputOverBlackListPatterns(String input, String... blackListPatterns) throws IdentityValidationException
input - inputblackListPatterns - a String array of black list pattern keysIdentityValidationExceptionpublic static String getValidInput(String input, String[] whiteListPatterns, String[] blackListPatterns) throws IdentityValidationException
input - inputwhiteListPatterns - a String array of white list pattern keysblackListPatterns - a String array of black list pattern keysIdentityValidationExceptionpublic static void addPattern(String key, String regex)
key - pattern keyregex - pattern regexpublic static void removePattern(String key)
key - pattern keypublic static boolean patternExists(String key)
key - pattern keyCopyright © 2016 WSO2. All rights reserved.