org.apache.cxf.jaxrs.utils
Class InjectionUtils
java.lang.Object
org.apache.cxf.jaxrs.utils.InjectionUtils
public final class InjectionUtils
- extends Object
Method Summary |
static Method |
checkProxy(Method methodToInvoke,
Object resourceObject)
|
static Object |
convertStringToPrimitive(String value,
Class<?> cls)
|
static Object |
convertStringToPrimitive(String value,
Class<?> cls,
Annotation[] anns)
|
static Object |
createParameterObject(List<String> paramValues,
Class<?> paramType,
Type genericType,
Annotation[] paramAnns,
String defaultValue,
boolean decoded,
ParameterType pathParam,
Message message)
|
static
|
createThreadLocalProxy(Class<T> type)
|
static String |
decodeValue(String value,
boolean decode,
ParameterType param)
|
static Object |
extractFieldValue(Field f,
Object o)
|
static Object |
extractFromMethod(Object requestObject,
Method method)
|
static Object |
extractFromMethod(Object requestObject,
Method method,
boolean logError)
|
static javax.ws.rs.core.MultivaluedMap<String,Object> |
extractValuesFromBean(Object bean,
String baseName)
|
static void |
fillInValuesFromBean(Object bean,
String baseName,
javax.ws.rs.core.MultivaluedMap<String,Object> values)
|
static Class<?> |
getActualType(Type genericType)
|
static Class<?> |
getActualType(Type genericType,
int pos)
|
static Type[] |
getActualTypes(Type genericType)
|
static Object |
getEntity(Object o)
|
static Type |
getGenericResponseType(Method invoked,
Class<?> serviceCls,
Object targetObject,
Class<?> targetType,
Exchange exchange)
|
static Method |
getGetterFromSetter(Method setter)
|
static Map<Parameter,Class<?>> |
getParametersFromBeanClass(Class<?> beanClass,
ParameterType type,
boolean checkIgnorable)
|
static Class<?> |
getRawResponseClass(Object targetObject)
|
static Class<?> |
getRawType(Type genericType)
|
static Type |
getSuperType(Class<?> serviceClass,
TypeVariable<?> var)
|
static Type |
getType(Type[] types,
int pos)
|
static Object |
handleBean(Class<?> paramType,
Annotation[] paramAnns,
javax.ws.rs.core.MultivaluedMap<String,String> values,
ParameterType pType,
Message message,
boolean decoded)
|
static
|
handleParameter(String value,
boolean decoded,
Class<T> pClass,
Annotation[] paramAnns,
ParameterType pType,
Message message)
|
static void |
injectConstructorProxies(Object o,
AbstractResourceInfo cri,
Message m)
|
static void |
injectContextField(AbstractResourceInfo cri,
Field f,
Object o,
Object value)
|
static void |
injectContextFields(Object o,
AbstractResourceInfo cri,
Message m)
|
static void |
injectContextMethods(Object requestObject,
AbstractResourceInfo cri,
Message message)
|
static void |
injectContextProxies(AbstractResourceInfo cri,
Object instance)
|
static void |
injectContextProxiesAndApplication(AbstractResourceInfo cri,
Object instance,
javax.ws.rs.core.Application app)
|
static void |
injectContexts(Object requestObject,
AbstractResourceInfo resource,
Message message)
|
static void |
injectFieldValue(Field f,
Object o,
Object v)
|
static void |
injectThroughMethod(Object requestObject,
Method method,
Object parameterValue)
|
static void |
injectThroughMethod(Object requestObject,
Method method,
Object parameterValue,
Message inMessage)
|
static void |
invokeLifeCycleMethod(Object instance,
Method method)
|
static boolean |
isConcreteClass(Class<?> cls)
|
static boolean |
isPrimitive(Class<?> type)
|
static boolean |
isSupportedCollectionOrArray(Class<?> type)
|
static Type |
processGenericTypeIfNeeded(Class<?> serviceCls,
Class<?> paramCls,
Type type)
|
static void |
reportServerError(String messageName,
String parameter)
|
static void |
reportServerError(String messageName,
String parameter,
boolean logError)
|
static Class<?> |
updateParamClassToTypeIfNeeded(Class<?> paramCls,
Type type)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
isConcreteClass
public static boolean isConcreteClass(Class<?> cls)
getSuperType
public static Type getSuperType(Class<?> serviceClass,
TypeVariable<?> var)
checkProxy
public static Method checkProxy(Method methodToInvoke,
Object resourceObject)
injectFieldValue
public static void injectFieldValue(Field f,
Object o,
Object v)
extractFieldValue
public static Object extractFieldValue(Field f,
Object o)
getActualType
public static Class<?> getActualType(Type genericType)
getActualType
public static Class<?> getActualType(Type genericType,
int pos)
getType
public static Type getType(Type[] types,
int pos)
getRawType
public static Class<?> getRawType(Type genericType)
getActualTypes
public static Type[] getActualTypes(Type genericType)
injectThroughMethod
public static void injectThroughMethod(Object requestObject,
Method method,
Object parameterValue)
injectThroughMethod
public static void injectThroughMethod(Object requestObject,
Method method,
Object parameterValue,
Message inMessage)
extractFromMethod
public static Object extractFromMethod(Object requestObject,
Method method)
extractFromMethod
public static Object extractFromMethod(Object requestObject,
Method method,
boolean logError)
handleParameter
public static <T> T handleParameter(String value,
boolean decoded,
Class<T> pClass,
Annotation[] paramAnns,
ParameterType pType,
Message message)
reportServerError
public static void reportServerError(String messageName,
String parameter)
reportServerError
public static void reportServerError(String messageName,
String parameter,
boolean logError)
handleBean
public static Object handleBean(Class<?> paramType,
Annotation[] paramAnns,
javax.ws.rs.core.MultivaluedMap<String,String> values,
ParameterType pType,
Message message,
boolean decoded)
isSupportedCollectionOrArray
public static boolean isSupportedCollectionOrArray(Class<?> type)
createParameterObject
public static Object createParameterObject(List<String> paramValues,
Class<?> paramType,
Type genericType,
Annotation[] paramAnns,
String defaultValue,
boolean decoded,
ParameterType pathParam,
Message message)
createThreadLocalProxy
public static <T> ThreadLocalProxy<T> createThreadLocalProxy(Class<T> type)
getGetterFromSetter
public static Method getGetterFromSetter(Method setter)
throws Exception
- Throws:
Exception
injectContextProxiesAndApplication
public static void injectContextProxiesAndApplication(AbstractResourceInfo cri,
Object instance,
javax.ws.rs.core.Application app)
injectContextProxies
public static void injectContextProxies(AbstractResourceInfo cri,
Object instance)
injectContextField
public static void injectContextField(AbstractResourceInfo cri,
Field f,
Object o,
Object value)
injectContexts
public static void injectContexts(Object requestObject,
AbstractResourceInfo resource,
Message message)
injectContextMethods
public static void injectContextMethods(Object requestObject,
AbstractResourceInfo cri,
Message message)
injectContextFields
public static void injectContextFields(Object o,
AbstractResourceInfo cri,
Message m)
injectConstructorProxies
public static void injectConstructorProxies(Object o,
AbstractResourceInfo cri,
Message m)
extractValuesFromBean
public static javax.ws.rs.core.MultivaluedMap<String,Object> extractValuesFromBean(Object bean,
String baseName)
fillInValuesFromBean
public static void fillInValuesFromBean(Object bean,
String baseName,
javax.ws.rs.core.MultivaluedMap<String,Object> values)
getParametersFromBeanClass
public static Map<Parameter,Class<?>> getParametersFromBeanClass(Class<?> beanClass,
ParameterType type,
boolean checkIgnorable)
isPrimitive
public static boolean isPrimitive(Class<?> type)
decodeValue
public static String decodeValue(String value,
boolean decode,
ParameterType param)
invokeLifeCycleMethod
public static void invokeLifeCycleMethod(Object instance,
Method method)
convertStringToPrimitive
public static Object convertStringToPrimitive(String value,
Class<?> cls)
convertStringToPrimitive
public static Object convertStringToPrimitive(String value,
Class<?> cls,
Annotation[] anns)
getRawResponseClass
public static Class<?> getRawResponseClass(Object targetObject)
getGenericResponseType
public static Type getGenericResponseType(Method invoked,
Class<?> serviceCls,
Object targetObject,
Class<?> targetType,
Exchange exchange)
updateParamClassToTypeIfNeeded
public static Class<?> updateParamClassToTypeIfNeeded(Class<?> paramCls,
Type type)
processGenericTypeIfNeeded
public static Type processGenericTypeIfNeeded(Class<?> serviceCls,
Class<?> paramCls,
Type type)
getEntity
public static Object getEntity(Object o)
Apache CXF