|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpicsou.util.GenericValidator
public class GenericValidator
This class contains basic methods for performing validations.
| Constructor Summary | |
|---|---|
GenericValidator()
|
|
| Method Summary | |
|---|---|
static boolean |
isBlankOrNull(java.lang.String value)
Checks if the field isn't null and length of the field is greater than zero not including whitespace. |
static boolean |
isByte(java.lang.String value)
Checks if the value can safely be converted to a byte primitive. |
static boolean |
isDouble(java.lang.String value)
Checks if the value can safely be converted to a double primitive. |
static boolean |
isFloat(java.lang.String value)
Checks if the value can safely be converted to a float primitive. |
static boolean |
isInRange(byte value,
byte min,
byte max)
Checks if a value is within a range (min & max specified in the vars attribute). |
static boolean |
isInRange(double value,
double min,
double max)
Checks if a value is within a range (min & max specified in the vars attribute). |
static boolean |
isInRange(float value,
float min,
float max)
Checks if a value is within a range (min & max specified in the vars attribute). |
static boolean |
isInRange(int value,
int min,
int max)
Checks if a value is within a range (min & max specified in the vars attribute). |
static boolean |
isInRange(long value,
long min,
long max)
Checks if a value is within a range (min & max specified in the vars attribute). |
static boolean |
isInRange(short value,
short min,
short max)
Checks if a value is within a range (min & max specified in the vars attribute). |
static boolean |
isInt(java.lang.String value)
Checks if the value can safely be converted to a int primitive. |
static boolean |
isLong(java.lang.String value)
Checks if the value can safely be converted to a long primitive. |
static boolean |
isShort(java.lang.String value)
Checks if the value can safely be converted to a short primitive. |
static boolean |
isURL(java.lang.String value)
Checks if a field is a valid url address. |
static boolean |
matchRegexp(java.lang.String value,
java.lang.String regexp)
Checks if the value matches the regular expression. |
static boolean |
maxLength(java.lang.String value,
int max)
Checks if the value's length is less than or equal to the max. |
static boolean |
maxLength(java.lang.String value,
int max,
int lineEndLength)
Checks if the value's adjusted length is less than or equal to the max. |
static boolean |
maxValue(double value,
double max)
Checks if the value is less than or equal to the max. |
static boolean |
maxValue(float value,
float max)
Checks if the value is less than or equal to the max. |
static boolean |
maxValue(int value,
int max)
Checks if the value is less than or equal to the max. |
static boolean |
maxValue(long value,
long max)
Checks if the value is less than or equal to the max. |
static boolean |
minLength(java.lang.String value,
int min)
Checks if the value's length is greater than or equal to the min. |
static boolean |
minLength(java.lang.String value,
int min,
int lineEndLength)
Checks if the value's adjusted length is greater than or equal to the min. |
static boolean |
minValue(double value,
double min)
Checks if the value is greater than or equal to the min. |
static boolean |
minValue(float value,
float min)
Checks if the value is greater than or equal to the min. |
static boolean |
minValue(int value,
int min)
Checks if the value is greater than or equal to the min. |
static boolean |
minValue(long value,
long min)
Checks if the value is greater than or equal to the min. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GenericValidator()
| Method Detail |
|---|
public static boolean isBlankOrNull(java.lang.String value)
Checks if the field isn't null and length of the field is greater than zero not including whitespace.
value - The value validation is being performed on.
public static boolean matchRegexp(java.lang.String value,
java.lang.String regexp)
Checks if the value matches the regular expression.
value - The value validation is being performed on.regexp - The regular expression.
public static boolean isByte(java.lang.String value)
Checks if the value can safely be converted to a byte primitive.
value - The value validation is being performed on.
public static boolean isShort(java.lang.String value)
Checks if the value can safely be converted to a short primitive.
value - The value validation is being performed on.
public static boolean isInt(java.lang.String value)
Checks if the value can safely be converted to a int primitive.
value - The value validation is being performed on.
public static boolean isLong(java.lang.String value)
Checks if the value can safely be converted to a long primitive.
value - The value validation is being performed on.
public static boolean isFloat(java.lang.String value)
Checks if the value can safely be converted to a float primitive.
value - The value validation is being performed on.
public static boolean isDouble(java.lang.String value)
Checks if the value can safely be converted to a double primitive.
value - The value validation is being performed on.
public static boolean isInRange(byte value,
byte min,
byte max)
Checks if a value is within a range (min & max specified in the vars attribute).
value - The value validation is being performed on.min - The minimum value of the range.max - The maximum value of the range.
public static boolean isInRange(int value,
int min,
int max)
Checks if a value is within a range (min & max specified in the vars attribute).
value - The value validation is being performed on.min - The minimum value of the range.max - The maximum value of the range.
public static boolean isInRange(float value,
float min,
float max)
Checks if a value is within a range (min & max specified in the vars attribute).
value - The value validation is being performed on.min - The minimum value of the range.max - The maximum value of the range.
public static boolean isInRange(short value,
short min,
short max)
Checks if a value is within a range (min & max specified in the vars attribute).
value - The value validation is being performed on.min - The minimum value of the range.max - The maximum value of the range.
public static boolean isInRange(long value,
long min,
long max)
Checks if a value is within a range (min & max specified in the vars attribute).
value - The value validation is being performed on.min - The minimum value of the range.max - The maximum value of the range.
public static boolean isInRange(double value,
double min,
double max)
Checks if a value is within a range (min & max specified in the vars attribute).
value - The value validation is being performed on.min - The minimum value of the range.max - The maximum value of the range.
public static boolean isURL(java.lang.String value)
Checks if a field is a valid url address.
If you need to modify what is considered valid then consider using the UrlValidator directly.
value - The value validation is being performed on.
public static boolean maxLength(java.lang.String value,
int max)
Checks if the value's length is less than or equal to the max.
value - The value validation is being performed on.max - The maximum length.
public static boolean maxLength(java.lang.String value,
int max,
int lineEndLength)
Checks if the value's adjusted length is less than or equal to the max.
value - The value validation is being performed on.max - The maximum length.lineEndLength - The length to use for line endings.
public static boolean minLength(java.lang.String value,
int min)
Checks if the value's length is greater than or equal to the min.
value - The value validation is being performed on.min - The minimum length.
public static boolean minLength(java.lang.String value,
int min,
int lineEndLength)
Checks if the value's adjusted length is greater than or equal to the min.
value - The value validation is being performed on.min - The minimum length.lineEndLength - The length to use for line endings.
public static boolean minValue(int value,
int min)
Checks if the value is greater than or equal to the min.
value - The value validation is being performed on.min - The minimum numeric value.
public static boolean minValue(long value,
long min)
Checks if the value is greater than or equal to the min.
value - The value validation is being performed on.min - The minimum numeric value.
public static boolean minValue(double value,
double min)
Checks if the value is greater than or equal to the min.
value - The value validation is being performed on.min - The minimum numeric value.
public static boolean minValue(float value,
float min)
Checks if the value is greater than or equal to the min.
value - The value validation is being performed on.min - The minimum numeric value.
public static boolean maxValue(int value,
int max)
Checks if the value is less than or equal to the max.
value - The value validation is being performed on.max - The maximum numeric value.
public static boolean maxValue(long value,
long max)
Checks if the value is less than or equal to the max.
value - The value validation is being performed on.max - The maximum numeric value.
public static boolean maxValue(double value,
double max)
Checks if the value is less than or equal to the max.
value - The value validation is being performed on.max - The maximum numeric value.
public static boolean maxValue(float value,
float max)
Checks if the value is less than or equal to the max.
value - The value validation is being performed on.max - The maximum numeric value.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||