public abstract class AbstractParamValidator extends Object implements ParamValidator
AbstractParamValidator
acts as a base class for implementations of ParamValidator
interface by providing some default method implementations and several utility methods for common validators.ParamValidator
Modifier | Constructor and Description |
---|---|
protected |
AbstractParamValidator() |
Modifier and Type | Method and Description |
---|---|
boolean |
equalValues(Parameter parameter,
Object value1,
Object value2)
Tests if the given two values are equal taking the given parameter information into account.
|
protected static boolean |
isAllowedNullText(Parameter parameter,
String text)
Tests if the given text is an allowed zero-length text string for the given parameter.
|
protected static boolean |
isAllowedNullValue(Parameter parameter,
Object value)
Tests if the given object is an allowed null value for the given parameter.
|
protected boolean |
isValueContainedInValueSet(Parameter parameter,
Object value)
Tests if the value passed in is containe in the value set defined by the Parameter passed as argument.
|
protected void |
validateThatNullValueIsAllowed(Parameter parameter,
Object value)
Tests if the value passed in is null, and if so, if this is an allowed value defined by the parameter.
|
protected void |
validateThatValueIsInValueSet(Parameter parameter,
Object value)
Checks if a value object is contained in the valueset defined by the parameter.
|
protected void |
validateThatValuesAreInValueSet(Parameter parameter,
Object[] values)
Checks if a vector of value objects is contained in the valueset defined bay the parameter.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
format, parse, validate
protected Logger _logger
public boolean equalValues(Parameter parameter, Object value1, Object value2)
ParamValidator
equalValues
in interface ParamValidator
parameter
- the parameter, must not be null
value1
- the first value, can be null
value2
- the second value, can also be null
true
if the value are equal, false
otherwiseprotected void validateThatNullValueIsAllowed(Parameter parameter, Object value) throws ParamValidateException
parameter
- the Parameter defining the null value behaviourvalue
- the value to be checkedParamValidateException
protected void validateThatValuesAreInValueSet(Parameter parameter, Object[] values) throws ParamValidateException
parameter
- the Parameter defining the valuesetvalues
- vector of objects to be checkedParamValidateException
protected void validateThatValueIsInValueSet(Parameter parameter, Object value) throws ParamValidateException
parameter
- the Parameter defining the valuesetvalue
- object to be checkedParamValidateException
protected boolean isValueContainedInValueSet(Parameter parameter, Object value)
parameter
- the parameter whose value set is to be checkedvalue
- the value to be checkedprotected static boolean isAllowedNullText(Parameter parameter, String text)
parameter
- the parametertext
- the text to testtrue
if soCopyright © 2002–2014 Brockmann Consult GmbH. All rights reserved.