|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ArgumentValidation
Field Summary | |
---|---|
static String |
VALIDATION_TYPE_NAME_ARGUMENT
|
static String |
VALIDATION_TYPE_NAME_PROPERTY_KEY
|
Method Summary | |
---|---|
void |
addError(String error)
Add an error message to the list of error messages. |
void |
addError(String argumentName,
String message)
Add an error message, for the given argumentName, to the list of error messages. |
void |
addError(String argumentName,
String key,
String message)
Add an error message, for when the argument is a Map instance, to the list of error messages, for the given key. |
boolean |
containsIllegalArgument()
Returns true if there are arguments checked (through one of the methods
isValidXxxxx ), that did not full fill the condition of that validation check,
otherwise false . |
IllegalArgumentException |
createIllegalArgumentException()
Creates an IllegalArgumentException with a detailed message about which
arguments did not satisfy the required conditions. |
String |
getMessage()
Creates a message about all the validated conditions which are not satisfied. |
Map<String,String> |
getPattern()
Returns the Map of pattern names and their regular expression. |
org.apache.oro.text.regex.Pattern |
getPattern(String patternName)
Returns the Pattern found under the patternName , or throws
an IllegalArgumentException if the patternName is not available. |
Set<String> |
getPatternNames()
Returns the Set of pattern names. |
String |
getRegularExpression(String patternName)
Returns the regular expression found under the patternName , or throws
an IllegalArgumentException if the patternName is not available. |
boolean |
isValidCollectionWhenMinElements(String argumentName,
Collection<?> argumentValue,
int minElements)
Validates if the Collection argumentValue is at least containing the
minimal number of elements (minElements ). |
boolean |
isValidCollectionWhenNoNulls(String argumentName,
Collection<?> argumentValue)
Validates if the Collection argumentValue is not null and that its
containing elements are also not null. |
boolean |
isValidMatchingDateFormat(String argumentName,
String argumentValue,
DateFormat dateFormat)
Validates if the String argumentValue matches the dateFormat . |
boolean |
isValidMatchingDateFormat(String argumentName,
String argumentValue,
String dateFormatName)
Validates if the String argumentValue matches the date format registered under the
dateFormatName . |
boolean |
isValidMatchingPattern(String argumentName,
String argumentValue,
String patternName)
Validates if the String argumentValue matches the pattern regisstered under the
patternName . |
boolean |
isValidNotNullForKey(String string,
Map<String,String> dataModelIdMap,
String keyDataVendor)
|
boolean |
isValidStringLength(String argumentName,
String argumentValue,
int length)
Validates if the String argumentValue has an exact length of length . |
boolean |
isValidStringMaxLength(String argumentName,
String argumentValue,
int maxLength)
Validates if the String argumentValue has a maximum length of maxLength . |
boolean |
isValidStringMinAndMaxLength(String argumentName,
String argumentValue,
int minLength,
int maxLength)
Validates if the String argumentValue has a minimal length of minLength and
a maximum length of maxLength . |
boolean |
isValidStringMinLength(String argumentName,
String argumentValue,
int minLength)
Validates if the String argumentValue has a minimal length of minLength . |
boolean |
isValidWhenBoolean(String argumentName,
String argumentValue)
Validates if the String argumentValue contains the text true or
false . |
boolean |
isValidWhenDirectory(String argumentName,
File argumentValue)
|
boolean |
isValidWhenDirectory(String argumentName,
String argumentValue)
Validates if the String argumentValue is a directory. |
boolean |
isValidWhenFile(String argumentName,
File argumentValue)
|
boolean |
isValidWhenFile(String argumentName,
String argumentValue)
Validates if the String argumentValue is a file. |
boolean |
isValidWhenGreaterThen(String argumentName,
int argumentValue,
int value)
Validates if the Integer argumentValue is greate then Integer value . |
boolean |
isValidWhenInSet(String argumentName,
String argumentValue,
Set<String> argumentSet)
Validates if the String argumentValue is an element contained by
the Set argumentSet . |
boolean |
isValidWhenInteger(String argumentName,
String argumentValue)
Validates if the String argumentValue is an Integer value. |
boolean |
isValidWhenLong(String argumentName,
String argumentValue)
Validates if the String argumentValue is a Long value. |
boolean |
isValidWhenNotInSet(String argumentName,
String argumentValue,
Set<String> argumentSet)
Validates if the String argumentValue is not already contained by
the Set argumentSet . |
boolean |
isValidWhenNotNull(String argumentName,
Object argumentValue)
Validates if the String argumentValue contains an instance reference
(is not null ). |
boolean |
isValidWhenNotNullInCollection(String string,
Collection<?> collection)
|
boolean |
isValidWhenUri(String argumentName,
String argumentValue)
Validates if the String argumentValue is an valid uri. |
boolean |
isValidWhenUrl(String argumentName,
String argumentValue)
Validates if the String argumentValue is an valid url. |
Field Detail |
---|
static final String VALIDATION_TYPE_NAME_ARGUMENT
static final String VALIDATION_TYPE_NAME_PROPERTY_KEY
Method Detail |
---|
String getMessage()
boolean containsIllegalArgument()
true
if there are arguments checked (through one of the methods
isValidXxxxx
), that did not full fill the condition of that validation check,
otherwise false
.
true
if not all validated conditions are satisfied, otherwise
false
.IllegalArgumentException createIllegalArgumentException()
IllegalArgumentException
with a detailed message about which
arguments did not satisfy the required conditions.
IllegalArgumentException
getMessage()
boolean isValidWhenNotNull(String argumentName, Object argumentValue)
argumentValue
contains an instance reference
(is not null
).
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.
true
if the condition is met, otherwise false
.boolean isValidWhenBoolean(String argumentName, String argumentValue)
argumentValue
contains the text true
or
false
.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.
true
if the condition is met, otherwise false
.boolean isValidWhenInteger(String argumentName, String argumentValue)
argumentValue
is an Integer value.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.
true
if the condition is met, otherwise false
.boolean isValidWhenLong(String argumentName, String argumentValue)
argumentValue
is a Long value.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.
true
if the condition is met, otherwise false
.boolean isValidWhenDirectory(String argumentName, String argumentValue)
argumentValue
is a directory.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.
true
if the condition is met, otherwise false
.boolean isValidWhenDirectory(String argumentName, File argumentValue)
boolean isValidWhenFile(String argumentName, String argumentValue)
argumentValue
is a file.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.
true
if the condition is met, otherwise false
.boolean isValidWhenFile(String argumentName, File argumentValue)
boolean isValidWhenUrl(String argumentName, String argumentValue)
argumentValue
is an valid url.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.
true
if the condition is met, otherwise false
.boolean isValidWhenUri(String argumentName, String argumentValue)
argumentValue
is an valid uri.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.
true
if the condition is met, otherwise false
.boolean isValidWhenInSet(String argumentName, String argumentValue, Set<String> argumentSet)
argumentValue
is an element contained by
the Set argumentSet
.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.argumentSet
- The Set
to validate against.
true
if the condition is met, otherwise false
.boolean isValidWhenNotInSet(String argumentName, String argumentValue, Set<String> argumentSet)
argumentValue
is not already contained by
the Set argumentSet
.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.argumentSet
- The Set
to validate against.
true
if the condition is met, otherwise false
.boolean isValidWhenNotNullInCollection(String string, Collection<?> collection)
boolean isValidCollectionWhenNoNulls(String argumentName, Collection<?> argumentValue)
argumentValue
is not null and that its
containing elements are also not null. Meaning the Collection may be empty. And when not
empty, each entry should contain a instance.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.
true
if the condition is met, otherwise false
.boolean isValidCollectionWhenMinElements(String argumentName, Collection<?> argumentValue, int minElements)
argumentValue
is at least containing the
minimal number of elements (minElements
).
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.minElements
- The minimal number of arguments, the collection should contain.
true
if the condition is met, otherwise false
.boolean isValidWhenGreaterThen(String argumentName, int argumentValue, int value)
argumentValue
is greate then Integer value
.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.value
- The value to validate against.
true
if the condition is met, otherwise false
.boolean isValidStringMinLength(String argumentName, String argumentValue, int minLength)
argumentValue
has a minimal length of minLength
.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.minLength
- The length to validate against.
true
if the condition is met, otherwise false
.boolean isValidStringMaxLength(String argumentName, String argumentValue, int maxLength)
argumentValue
has a maximum length of maxLength
.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.maxLength
- The length to validate against.
true
if the condition is met, otherwise false
.boolean isValidStringLength(String argumentName, String argumentValue, int length)
argumentValue
has an exact length of length
.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.length
- The length to validate against.
true
if the condition is met, otherwise false
.boolean isValidStringMinAndMaxLength(String argumentName, String argumentValue, int minLength, int maxLength)
argumentValue
has a minimal length of minLength
and
a maximum length of maxLength
.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.minLength
- The minimal length to validate against.maxLength
- The maximum length to validate against.
true
if the condition is met, otherwise false
.boolean isValidMatchingDateFormat(String argumentName, String argumentValue, DateFormat dateFormat)
argumentValue
matches the dateFormat
.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.dateFormat
- The date format which is used for matching.
true
if the condition is met, otherwise false
.boolean isValidMatchingDateFormat(String argumentName, String argumentValue, String dateFormatName)
argumentValue
matches the date format registered under the
dateFormatName
.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.patternName
- The name of the date format, which is used for matching.
true
if the condition is met, otherwise false
.isValidMatchingDateFormat(String, String, DateFormat)
boolean isValidMatchingPattern(String argumentName, String argumentValue, String patternName)
argumentValue
matches the pattern regisstered under the
patternName
.
argumentName
- The name of the argument, which is validated.argumentValue
- The value of the argument, which is validated.patternName
- The name of the pattern, which is used for matching.
true
if the condition is met, otherwise false
.void addError(String error)
IllegalArgumentException
message.
error
- The error message to add.addError(String, String)
void addError(String argumentName, String message)
argumentName
- - the argument (or property-key) in which the problem is found.message
- - the message that describes the problem.void addError(String argumentName, String key, String message)
argumentName
- - the argument Map (or property-key).key
- - the key under which the problem is found.message
- - the message that describes the problem.Set<String> getPatternNames()
Set
of pattern names.
Map<String,String> getPattern()
Map
of pattern names and their regular expression.
String
).org.apache.oro.text.regex.Pattern getPattern(String patternName)
Pattern
found under the patternName
, or throws
an IllegalArgumentException
if the patternName
is not available.
patternName
- The name of the pattern.
Pattern
.String getRegularExpression(String patternName)
patternName
, or throws
an IllegalArgumentException
if the patternName
is not available.
patternName
- The name of the pattern.
boolean isValidNotNullForKey(String string, Map<String,String> dataModelIdMap, String keyDataVendor)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |