|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.ralscha.extdirectspring.util.ExtDirectSpringUtil
public class ExtDirectSpringUtil
Utility class
| Method Summary | ||
|---|---|---|
static
|
deserializeJsonToObject(String json,
Class<T> clazz)
Creates a object from a json String. |
|
static
|
deserializeJsonToObject(String json,
org.codehaus.jackson.type.TypeReference<T> typeReference)
Creates a object from a json String. |
|
static boolean |
equal(Object a,
Object b)
Checks if two objects are equal. |
|
static MethodInfo |
findMethodInfo(org.springframework.context.ApplicationContext context,
String beanName,
String methodName)
Retrieves a methodInfo from a method in a spring managed bean. |
|
static Method |
findMethodWithAnnotation(Method method,
Class<? extends Annotation> annotation)
Find a method that is annotated with a specific annotation. |
|
static Object |
invoke(org.springframework.context.ApplicationContext context,
String beanName,
MethodInfo methodInfo,
Object[] params)
Invokes a method on a Spring managed bean. |
|
static String |
serializeObjectToJson(Object obj)
Converts a object into a String containing the json representation of this object. |
|
static String |
serializeObjectToJson(Object obj,
boolean indent)
Converts a object into a String containing the json representation of this object. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean equal(Object a,
Object b)
a - object oneb - object two
public static MethodInfo findMethodInfo(org.springframework.context.ApplicationContext context,
String beanName,
String methodName)
MethodInfoCache with the key
beanName,methodName
context - Spring application contextbeanName - name of the bean to find the method inmethodName - name of the method to retrieve
IllegalArgumentException - if the method is not annotated with a ExtDirectSpring annotation
or there is no method in the bean
public static Method findMethodWithAnnotation(Method method,
Class<? extends Annotation> annotation)
method - the starting methodannotation - the annotation to look for
public static Object invoke(org.springframework.context.ApplicationContext context,
String beanName,
MethodInfo methodInfo,
Object[] params)
throws IllegalArgumentException,
IllegalAccessException,
InvocationTargetException
context - a Spring application contextbeanName - the name of the beanmethodInfo - the methodInfo objectparams - the parameters
IllegalArgumentException - if there is no bean in the context
IllegalAccessException
InvocationTargetExceptionpublic static String serializeObjectToJson(Object obj)
obj - the object to serialize into json
public static String serializeObjectToJson(Object obj,
boolean indent)
obj - the object to serialize into jsonindent - if false writes json on one line
public static <T> T deserializeJsonToObject(String json,
org.codehaus.jackson.type.TypeReference<T> typeReference)
T - type of the object to createjson - String with the jsontypeReference - TypeReference instance of the desired result type
TypeReference
public static <T> T deserializeJsonToObject(String json,
Class<T> clazz)
T - type of the object to createjson - String with the jsonclazz - Class of object to create
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||