|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.crispy.util.Converter
Convert complex object in a simple form and back to the object.
Field Summary | |
protected static ClassPropertiesCache |
classPropertiesCacheGetter
|
protected static ClassPropertiesCache |
classPropertiesCacheSetter
|
static int |
GET_METHOD
|
static java.lang.String |
HASH_CODE_KEY
|
protected static java.util.Map |
isSimpleDataType
|
protected static org.apache.commons.logging.Log |
log
|
static int |
SET_METHOD
|
Constructor Summary | |
Converter()
|
|
Converter(int pvStartHashCode)
|
|
Converter(java.lang.String pvNullValue)
|
Method Summary | |
static java.lang.Object |
convertClassString2Object(java.lang.String pvClassName)
|
static java.lang.Object |
convertString2Value(java.lang.Object pvValue,
java.lang.Class pvClass)
|
static java.lang.Object |
convertString2Value(java.lang.String pvStringValue,
java.lang.Class pvClass)
For example String to Integer or String to Date, ... |
static java.lang.Object |
convertString2Value(java.lang.String pvStringValue,
java.lang.String pvClassName)
For example String to Integer or String to Date, ... |
static java.lang.Object[] |
convertStringParams2MethodParams(java.lang.reflect.Method pvMethod,
java.util.Vector pvParams)
Convert String-Parameter (contains in the Vector) in Method-ParameterTypes. |
static java.lang.Object |
createDefaultValueForPrimitiveClass(java.lang.Class pvClass)
|
static java.lang.Object |
createObjectWithParamConstructor(java.lang.Object pvParam,
java.lang.Class pvParamType,
java.lang.String pvClassName)
|
static java.lang.String |
extractHashCode(java.lang.Object pvObject)
If pvObject.toString - method start with Converter.HASH_CODE_KEY , then extract
the hash code.
|
java.lang.String |
findNextFreeId(int pvHashCode)
|
static java.util.Map |
getAllGetterAndSetterMethod(java.lang.Class pvClass,
int pvMethodType)
|
static java.util.Map |
getAllGetterMethod(java.lang.Class pvClass)
Find all getter-method from a Class. |
static java.util.Map |
getAllGetterMethodWithCache(java.lang.Class pvClass)
Find all getter-method from a Class and remove all getter-method where no setter-method exist. |
static java.lang.reflect.Method[] |
getAllMethodsByClass(java.lang.Class pvClass)
Get all set/get methods from a Class. |
static java.util.Map |
getAllNotEqualsGetterAndSetterAndRemoveThisProperties(java.util.Map pvGetterMap,
java.util.Map pvSetterMap)
Remove all getter-method where no setter-method exist. |
static java.util.Map |
getAllSetterMethod(java.lang.Class pvClass)
Find all setter-method from a Class. |
static java.util.Map |
getAllSetterMethodWithCache(java.lang.Class pvClass)
Find all setter-method from a Class. |
static java.lang.Class |
getArrayType(java.lang.Object pvListObj)
Analysed the objects in an Array/Collection. |
static java.lang.String |
getClassWithoutPackage(java.lang.String pvClassWitchPackage,
boolean pvToLowerCase)
Extract from package + class name, the class name. |
java.lang.String |
getNullValue()
|
boolean |
getWithSimpleKeyMapper()
|
static boolean |
isValideEdge(java.lang.Object pvObject)
|
static java.lang.Object |
makeAssignable(java.lang.Class pvSourceClass,
java.lang.Object pvValue)
|
java.lang.Object |
makeComplex(java.lang.Object pvObject)
|
java.lang.Object |
makeComplex(java.lang.Object pvObject,
java.lang.Class clazz)
|
java.lang.Object |
makeComplex(java.lang.Object pvObject,
java.lang.Class clazz,
java.lang.Class clazzInArray)
|
java.lang.Object |
makeSimple(java.lang.Object pvObject)
Convert complex object in a Hashtable and relations in Vector. |
void |
setNullValue(java.lang.String pvNullValue)
|
void |
setWithSimpleKeyMapper(boolean pvWithSimpleKeyMapper)
|
static java.util.Date |
string2Date(java.lang.String pvDateString)
Convert a Date-String to a Date. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String HASH_CODE_KEY
public static final int GET_METHOD
public static final int SET_METHOD
protected static final org.apache.commons.logging.Log log
protected static final java.util.Map isSimpleDataType
protected static final ClassPropertiesCache classPropertiesCacheGetter
protected static final ClassPropertiesCache classPropertiesCacheSetter
Constructor Detail |
public Converter()
public Converter(java.lang.String pvNullValue)
public Converter(int pvStartHashCode)
Method Detail |
public void setWithSimpleKeyMapper(boolean pvWithSimpleKeyMapper)
public boolean getWithSimpleKeyMapper()
public static boolean isValideEdge(java.lang.Object pvObject)
public java.lang.String getNullValue()
public void setNullValue(java.lang.String pvNullValue)
public java.lang.String findNextFreeId(int pvHashCode)
public java.lang.Object makeSimple(java.lang.Object pvObject) throws java.lang.Exception
pvObject
- Complex or simple object.
java.lang.Exception
public java.lang.Object makeComplex(java.lang.Object pvObject) throws java.lang.Exception
java.lang.Exception
public java.lang.Object makeComplex(java.lang.Object pvObject, java.lang.Class clazz) throws java.lang.Exception
java.lang.Exception
public java.lang.Object makeComplex(java.lang.Object pvObject, java.lang.Class clazz, java.lang.Class clazzInArray) throws java.lang.Exception
java.lang.Exception
public static java.lang.Object makeAssignable(java.lang.Class pvSourceClass, java.lang.Object pvValue)
public static java.lang.Class getArrayType(java.lang.Object pvListObj)
pvListObj
-
public static java.lang.Object convertClassString2Object(java.lang.String pvClassName) throws java.lang.Exception
java.lang.Exception
public static java.lang.Object createObjectWithParamConstructor(java.lang.Object pvParam, java.lang.Class pvParamType, java.lang.String pvClassName)
public static java.lang.Object convertString2Value(java.lang.String pvStringValue, java.lang.String pvClassName) throws java.lang.Exception
pvStringValue
- Value in String class.pvClassName
- Class name to convert the String value.
java.lang.Exception
public static java.lang.Object convertString2Value(java.lang.Object pvValue, java.lang.Class pvClass)
public static java.lang.Object convertString2Value(java.lang.String pvStringValue, java.lang.Class pvClass)
pvStringValue
- Value in String class.pvClass
- Type to convert the String value.
public static java.lang.Object[] convertStringParams2MethodParams(java.lang.reflect.Method pvMethod, java.util.Vector pvParams)
pvMethod
- Method with ParameterTypes.pvParams
- Vector with Strings.
public static java.util.Date string2Date(java.lang.String pvDateString)
pvDateString
- The Date-String (unequal null).
java.util.Date
.public static java.lang.String getClassWithoutPackage(java.lang.String pvClassWitchPackage, boolean pvToLowerCase)
pvToLowerCase = false)
): Input: net.sf.crispy.ServiceManager
-> Output: ServiceManger
.
Example (pvToLowerCase = true)
): Input: net.sf.crispy.ServiceManager
-> Output: servicemanger
.
pvClassWitchPackage
- pvToLowerCase
-
public static java.lang.String extractHashCode(java.lang.Object pvObject)
Converter.HASH_CODE_KEY
, then extract
the hash code.
Example: make from ~hashCode~24306761
to 24306761
.
pvObject
-
public static java.util.Map getAllNotEqualsGetterAndSetterAndRemoveThisProperties(java.util.Map pvGetterMap, java.util.Map pvSetterMap)
public static java.util.Map getAllGetterMethodWithCache(java.lang.Class pvClass) throws java.beans.IntrospectionException
pvClass
- Class to anaylse.
java.beans.IntrospectionException
public static java.util.Map getAllSetterMethodWithCache(java.lang.Class pvClass) throws java.beans.IntrospectionException
pvClass
- Class to analyse.
java.beans.IntrospectionException
public static java.util.Map getAllGetterMethod(java.lang.Class pvClass) throws java.beans.IntrospectionException
pvClass
- Class to analyse.
java.beans.IntrospectionException
public static java.util.Map getAllSetterMethod(java.lang.Class pvClass) throws java.beans.IntrospectionException
pvClass
- Class to analyse.
java.beans.IntrospectionException
public static java.lang.reflect.Method[] getAllMethodsByClass(java.lang.Class pvClass)
pvClass
- Analyse Class.
public static java.util.Map getAllGetterAndSetterMethod(java.lang.Class pvClass, int pvMethodType) throws java.beans.IntrospectionException
pvClass
- Find all get or set method from a Class.pvMethodType
- get or set
java.beans.IntrospectionException
public static java.lang.Object createDefaultValueForPrimitiveClass(java.lang.Class pvClass)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |