| java.lang.Object net.sf.crispy.util.Converter
Converter | public class Converter (Code) | | Convert complex object in a simple form and back to the object.
author: Linke |
Method Summary | |
public static Object | convertClassString2Object(String pvClassName) | public static Object | convertString2Value(String pvStringValue, String pvClassName) For example String to Integer or String to Date, ...
Parameters: pvStringValue - Value in String class. Parameters: pvClassName - Class name to convert the String value. | public static Object | convertString2Value(Object pvValue, Class pvClass) | public static Object | convertString2Value(String pvStringValue, Class pvClass) For example String to Integer or String to Date, ...
Parameters: pvStringValue - Value in String class. Parameters: pvClass - Type to convert the String value. | public static Object[] | convertStringParams2MethodParams(Method pvMethod, Vector pvParams) Convert String-Parameter (contains in the Vector) in Method-ParameterTypes.
For example: Vector ["5", "8"] convert to new Integer [] { new Integer(5), new Integer (8) }
Parameters: pvMethod - Method with ParameterTypes. Parameters: pvParams - Vector with Strings. | public static Object | createDefaultValueForPrimitiveClass(Class pvClass) | public static Object | createObjectWithParamConstructor(Object pvParam, Class pvParamType, String pvClassName) | public static String | extractHashCode(Object pvObject) If pvObject.toString - method start with Converter.HASH_CODE_KEY , then extract
the hash code. | public String | findNextFreeId(int pvHashCode) | public static Map | getAllGetterAndSetterMethod(Class pvClass, int pvMethodType) | public static Map | getAllGetterMethod(Class pvClass) Find all getter-method from a Class.
Parameters: pvClass - Class to analyse. | public static Map | getAllGetterMethodWithCache(Class pvClass) Find all getter-method from a Class and remove all getter-method where no setter-method exist.
Parameters: pvClass - Class to anaylse. | public static Method[] | getAllMethodsByClass(Class pvClass) Get all set/get methods from a Class. | public static Map | getAllNotEqualsGetterAndSetterAndRemoveThisProperties(Map pvGetterMap, Map pvSetterMap) Remove all getter-method where no setter-method exist. | public static Map | getAllSetterMethod(Class pvClass) Find all setter-method from a Class.
Parameters: pvClass - Class to analyse. | public static Map | getAllSetterMethodWithCache(Class pvClass) Find all setter-method from a Class.
Parameters: pvClass - Class to analyse. | public static Class | getArrayType(Object pvListObj) Analysed the objects in an Array/Collection. | public static String | getClassWithoutPackage(String pvClassWitchPackage, boolean pvToLowerCase) Extract from package + class name, the class name. | public String | getNullValue() | public boolean | getWithSimpleKeyMapper() | public static boolean | isValideEdge(Object pvObject) | public static Object | makeAssignable(Class pvSourceClass, Object pvValue) | public Object | makeComplex(Object pvObject) | public Object | makeComplex(Object pvObject, Class clazz) | public Object | makeComplex(Object pvObject, Class clazz, Class clazzInArray) | public Object | makeSimple(Object pvObject) Convert complex object in a Hashtable and relations in Vector.
Cycles are finded and removed.
Parameters: pvObject - Complex or simple object. | public void | setNullValue(String pvNullValue) | public void | setWithSimpleKeyMapper(boolean pvWithSimpleKeyMapper) | public static Date | string2Date(String pvDateString) Convert a Date-String to a Date. |
GET_METHOD | final public static int GET_METHOD(Code) | | |
SET_METHOD | final public static int SET_METHOD(Code) | | |
isSimpleDataType | final protected static Map isSimpleDataType(Code) | | |
log | final protected static Log log(Code) | | |
Converter | public Converter()(Code) | | |
Converter | public Converter(int pvStartHashCode)(Code) | | |
convertString2Value | public static Object convertString2Value(String pvStringValue, String pvClassName) throws Exception(Code) | | For example String to Integer or String to Date, ...
Parameters: pvStringValue - Value in String class. Parameters: pvClassName - Class name to convert the String value. The converted String value. |
convertString2Value | public static Object convertString2Value(String pvStringValue, Class pvClass)(Code) | | For example String to Integer or String to Date, ...
Parameters: pvStringValue - Value in String class. Parameters: pvClass - Type to convert the String value. The converted String value. |
convertStringParams2MethodParams | public static Object[] convertStringParams2MethodParams(Method pvMethod, Vector pvParams)(Code) | | Convert String-Parameter (contains in the Vector) in Method-ParameterTypes.
For example: Vector ["5", "8"] convert to new Integer [] { new Integer(5), new Integer (8) }
Parameters: pvMethod - Method with ParameterTypes. Parameters: pvParams - Vector with Strings. Array with ParameterTypes and ParameterValues. |
createDefaultValueForPrimitiveClass | public static Object createDefaultValueForPrimitiveClass(Class pvClass)(Code) | | |
createObjectWithParamConstructor | public static Object createObjectWithParamConstructor(Object pvParam, Class pvParamType, String pvClassName)(Code) | | |
extractHashCode | public static String extractHashCode(Object pvObject)(Code) | | If pvObject.toString - method start with Converter.HASH_CODE_KEY , then extract
the hash code.
Example: make from ~hashCode~24306761 to 24306761 .
Parameters: pvObject - The hash code. |
findNextFreeId | public String findNextFreeId(int pvHashCode)(Code) | | |
getAllGetterAndSetterMethod | public static Map getAllGetterAndSetterMethod(Class pvClass, int pvMethodType) throws IntrospectionException(Code) | | Parameters: pvClass - Find all get or set method from a Class. Parameters: pvMethodType - get or set Method map (key=property name, value=method). throws: IntrospectionException - |
getAllGetterMethodWithCache | public static Map getAllGetterMethodWithCache(Class pvClass) throws IntrospectionException(Code) | | Find all getter-method from a Class and remove all getter-method where no setter-method exist.
Parameters: pvClass - Class to anaylse. Map from getter-method (key=property name, value=method). throws: IntrospectionException - |
getAllMethodsByClass | public static Method[] getAllMethodsByClass(Class pvClass)(Code) | | Get all set/get methods from a Class. With methods from all super classes.
Parameters: pvClass - Analyse Class. All finded methods. |
getAllNotEqualsGetterAndSetterAndRemoveThisProperties | public static Map getAllNotEqualsGetterAndSetterAndRemoveThisProperties(Map pvGetterMap, Map pvSetterMap)(Code) | | Remove all getter-method where no setter-method exist.
|
getArrayType | public static Class getArrayType(Object pvListObj)(Code) | | Analysed the objects in an Array/Collection. If all Object from the same class type,
then is the return value this class. If are several class types in the Array,
then ist the return class from type Object.
Parameters: pvListObj - Class, that are in the Array or Collection |
getClassWithoutPackage | public static String getClassWithoutPackage(String pvClassWitchPackage, boolean pvToLowerCase)(Code) | | Extract from package + class name, the class name.
Example (pvToLowerCase = false) ): Input: net.sf.crispy.ServiceManager -> Output: ServiceManger .
Example (pvToLowerCase = true) ): Input: net.sf.crispy.ServiceManager -> Output: servicemanger .
Parameters: pvClassWitchPackage - Parameters: pvToLowerCase - The class without package. |
getWithSimpleKeyMapper | public boolean getWithSimpleKeyMapper()(Code) | | |
isValideEdge | public static boolean isValideEdge(Object pvObject)(Code) | | |
makeSimple | public Object makeSimple(Object pvObject) throws Exception(Code) | | Convert complex object in a Hashtable and relations in Vector.
Cycles are finded and removed.
Parameters: pvObject - Complex or simple object. Simple object structure. throws: Exception - |
setNullValue | public void setNullValue(String pvNullValue)(Code) | | |
setWithSimpleKeyMapper | public void setWithSimpleKeyMapper(boolean pvWithSimpleKeyMapper)(Code) | | |
string2Date | public static Date string2Date(String pvDateString)(Code) | | Convert a Date-String to a Date. The Converter neglected the Millisecond.
Example: Thu Aug 11 19:30:57 CEST 2005
Parameters: pvDateString - The Date-String (unequal null). Valid java.util.Date . |
|
|