org.kuali.rice.krad.util
Class DataTypeUtil

java.lang.Object
  extended by org.kuali.rice.krad.util.DataTypeUtil

public class DataTypeUtil
extends Object

Pulled this logic out of the org.kuali.rice.krad.workflow.service.impl.WorkflowAttributePropertyResolutionServiceImpl since it wasn't really service logic at all, just util logic.

Author:
James Renfro

Constructor Summary
DataTypeUtil()
           
 
Method Summary
static String determineDataType(Class<?> attributeClass)
          Determines the datatype of the given class.
static String determineFieldDataType(Class<? extends BusinessObject> businessObjectClass, String attributeName)
           
static boolean isBooleanable(Class clazz)
          Determines if the given class is enough like a boolean, to index it as a String "Y" or "N"
static boolean isDateLike(Class clazz)
          Determines if the given class is enough like a date to store values of it as a SearchableAttributeDateTimeValue
static boolean isDecimaltastic(Class clazz)
          Determines if the given class is enough like a Float to store values of it as a SearchableAttributeFloatValue
static boolean isIntsy(Class clazz)
          Determines if the given class is enough like a "long" to store values of it as a SearchableAttributeLongValue
static boolean isStringy(Class clazz)
          Determines if the given Class is a String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTypeUtil

public DataTypeUtil()
Method Detail

determineFieldDataType

public static String determineFieldDataType(Class<? extends BusinessObject> businessObjectClass,
                                            String attributeName)

determineDataType

public static String determineDataType(Class<?> attributeClass)
Determines the datatype of the given class.

Parameters:
attributeClass - the class whose datatype is to be determined.
Returns:
String representation of the datatype. Defaults to string.

isStringy

public static boolean isStringy(Class clazz)
Determines if the given Class is a String

Parameters:
clazz - the class to check for Stringiness
Returns:
true if the Class is a String, false otherwise

isDateLike

public static boolean isDateLike(Class clazz)
Determines if the given class is enough like a date to store values of it as a SearchableAttributeDateTimeValue

Parameters:
clazz - the class to determine the type of
Returns:
true if it is like a date, false otherwise

isDecimaltastic

public static boolean isDecimaltastic(Class clazz)
Determines if the given class is enough like a Float to store values of it as a SearchableAttributeFloatValue

Parameters:
clazz - the class to determine of the type of
Returns:
true if it is like a "float", false otherwise

isIntsy

public static boolean isIntsy(Class clazz)
Determines if the given class is enough like a "long" to store values of it as a SearchableAttributeLongValue

Parameters:
clazz - the class to determine the type of
Returns:
true if it is like a "long", false otherwise

isBooleanable

public static boolean isBooleanable(Class clazz)
Determines if the given class is enough like a boolean, to index it as a String "Y" or "N"

Parameters:
clazz - the class to determine the type of
Returns:
true if it is like a boolean, false otherwise


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.