|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.javalid.core.validator.ValidatorSupport
public class ValidatorSupport
Contains a couple of shared methods used by the standard JavalidValidator implementation classes and some other core classes.
Changes for 1.1
| Method Summary | |
|---|---|
static void |
compareCalendars(DateCheck annotation,
java.util.Calendar calAnnotation,
java.util.Calendar calValue,
int mode,
java.util.List<ValidationMessage> messages,
java.lang.String validationPath)
Compares two calendars according given mode (mode from @DateCheck). |
static java.util.Calendar |
convertDateToCalendar(java.util.Date value,
int convertType)
Converts given date to a Calendar instance using given convertType (see DateCheck.TYPE_CONVERT_*) |
static java.lang.String |
convertDateToString(java.util.Date date,
java.lang.String pattern)
Converts given date to a string, using given pattern. |
static java.util.Date |
convertStringToDate(java.lang.String date,
java.lang.String pattern)
Converts given string to a date using given pattern, raises JavalidException if conversion fails |
static java.math.BigDecimal |
getAsBigDecimal(java.lang.String value)
Tries to convert value to BigDecimal, returns on success. |
static java.math.BigInteger |
getAsBigInteger(java.lang.String value)
Tries to convert value to BigInteger, returns on success. |
static ValidatorCallInfo |
getValidatorCallInfo()
Convenience method, which retrieves the current ValidatorInfo associated with this thread and clones it, then returns the value. |
static double |
getValueAsDouble(java.lang.Object value)
For given value, try to convert it to a double value and return it. |
static boolean |
isBigMathNumber(java.lang.Object value)
Returns true if given value is a big number (BigInteger or BigDecimal). |
static boolean |
isEmptyString(java.lang.String value)
Returns true if given string is either null or has a length of 0. |
static boolean |
isNumericValue(java.lang.Object value)
Returns true if given value is a numeric value (either as wrapper or as real primitive, which is now in a wrapper anyway). |
static boolean |
validationMustBeAppliedToGroup(java.lang.String[] applyToGroups,
java.lang.String groupName,
java.lang.String[] jvGroupNames)
Checks given applyToGroups array on given group name or JvGroup.GROUP_APPLY_ALL. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final boolean validationMustBeAppliedToGroup(java.lang.String[] applyToGroups,
java.lang.String groupName,
java.lang.String[] jvGroupNames)
applyToGroups - Contains the array of groups where to apply an annotation togroupName - The name of the group to check for (note JvGroup.GROUP_APPLY_ALL found
in the applyToGroups array will return true if groupName exists in jvGroupNames)
public static final double getValueAsDouble(java.lang.Object value)
value - The value to convert
public static final boolean isNumericValue(java.lang.Object value)
value - the value to check
public static final boolean isBigMathNumber(java.lang.Object value)
value - The value to check
public static final java.math.BigInteger getAsBigInteger(java.lang.String value)
value - The value to convert
public static final java.math.BigDecimal getAsBigDecimal(java.lang.String value)
value - The value to convert
public static final boolean isEmptyString(java.lang.String value)
value - The value to check
public static final ValidatorCallInfo getValidatorCallInfo()
public static final java.util.Date convertStringToDate(java.lang.String date,
java.lang.String pattern)
date - The date to convertpattern - The pattern to use
public static final java.lang.String convertDateToString(java.util.Date date,
java.lang.String pattern)
date - Date to convert to stringpattern - The pattern to use
public static final java.util.Calendar convertDateToCalendar(java.util.Date value,
int convertType)
value - The value to convert to calendarconvertType - The convertType to use
public static final void compareCalendars(DateCheck annotation,
java.util.Calendar calAnnotation,
java.util.Calendar calValue,
int mode,
java.util.List<ValidationMessage> messages,
java.lang.String validationPath)
annotation - The annotationcalAnnotation - The annotation value that was ON the datecheck annotationcalValue - The actual value under validation (converted to a calendar)mode - The mode to usemessages - The messages to add tovalidationPath - The current validation path
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||