org.kuali.rice.krad.datadictionary.validation
Class ValidationUtils
java.lang.Object
org.kuali.rice.krad.datadictionary.validation.ValidationUtils
public class ValidationUtils
- extends Object
Inherited from Kuali Student and adapted extensively, this class provides static utility methods for validation processing.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
Method Summary |
static String |
buildPath(String attributePath,
String attributeName)
|
static boolean |
compareValues(Object value1,
Object value2,
DataType dataType,
String operator,
boolean isCaseSensitive,
DateTimeService dateTimeService)
|
static Object |
convertToDataType(Object value,
DataType dataType,
DateTimeService dateTimeService)
|
static Boolean |
getBoolean(Object o)
|
static Date |
getDate(Object o,
DateTimeService dateTimeService)
|
static Double |
getDouble(Object o)
|
static Float |
getFloat(Object o)
|
static Integer |
getInteger(Object o)
|
static int |
getLastPathIndex(String attributePath)
Used to get the rightmost index value of an attribute path. |
static Long |
getLong(Object o)
|
static String[] |
getPathTokens(String fieldPath)
|
static String |
getString(Object o)
|
static boolean |
hasText(String string)
|
static
|
isGreaterThan(T value,
Comparable<T> limit)
|
static
|
isGreaterThanOrEqual(T value,
Comparable<T> limit)
|
static
|
isLessThan(T value,
Comparable<T> limit)
|
static
|
isLessThanOrEqual(T value,
Comparable<T> limit)
|
static boolean |
isNullOrEmpty(Object value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ValidationUtils
public ValidationUtils()
buildPath
public static String buildPath(String attributePath,
String attributeName)
getLastPathIndex
public static int getLastPathIndex(String attributePath)
- Used to get the rightmost index value of an attribute path.
- Parameters:
attributePath
-
- Returns:
- the right index of value of attribute path, -1 if path has no index
compareValues
public static boolean compareValues(Object value1,
Object value2,
DataType dataType,
String operator,
boolean isCaseSensitive,
DateTimeService dateTimeService)
getInteger
public static Integer getInteger(Object o)
getLong
public static Long getLong(Object o)
getFloat
public static Float getFloat(Object o)
getDouble
public static Double getDouble(Object o)
getDate
public static Date getDate(Object o,
DateTimeService dateTimeService)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
getString
public static String getString(Object o)
getBoolean
public static Boolean getBoolean(Object o)
hasText
public static boolean hasText(String string)
isNullOrEmpty
public static boolean isNullOrEmpty(Object value)
convertToDataType
public static Object convertToDataType(Object value,
DataType dataType,
DateTimeService dateTimeService)
throws AttributeValidationException
- Throws:
AttributeValidationException
isGreaterThan
public static <T> ValidationUtils.Result isGreaterThan(T value,
Comparable<T> limit)
isGreaterThanOrEqual
public static <T> ValidationUtils.Result isGreaterThanOrEqual(T value,
Comparable<T> limit)
isLessThan
public static <T> ValidationUtils.Result isLessThan(T value,
Comparable<T> limit)
isLessThanOrEqual
public static <T> ValidationUtils.Result isLessThanOrEqual(T value,
Comparable<T> limit)
getPathTokens
public static String[] getPathTokens(String fieldPath)
Copyright © 2005-2011 The Kuali Foundation. All Rights Reserved.