Class WrapperUtil
- java.lang.Object
-
- org.restlet.ext.jaxrs.internal.wrappers.WrapperUtil
-
@Deprecated public class WrapperUtil extends java.lang.ObjectDeprecated.Will be removed in next minor release.Utility methods for the wrappers.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringJAX_RS_PACKAGE_PREFIXDeprecated.
-
Constructor Summary
Constructors Constructor Description WrapperUtil()Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description (package private) static booleancheckForJaxRsAnnotations(java.lang.reflect.Method javaMethod)Deprecated.Checks, if the given annotation is annotated with at least one JAX-RS related annotation.private static booleancheckParamAnnotations(java.lang.reflect.Constructor<?> constr)Deprecated.Checks if the parameters for the constructor are valid for a JAX-RS root resource class.private static booleancheckParameterAnnotation(java.lang.annotation.Annotation[] parameterAnnotations, java.lang.Class<?> parameterType)Deprecated.Checks, if the annotations are valid for a runtime environment handled constructor.static java.util.List<MediaType>convertToMediaTypes(java.lang.String[] mimes)Deprecated.Converts the given mimes to a List of MediaTypes.static java.lang.ObjectcreateInstance(java.lang.reflect.Constructor<?> constructor, java.lang.Object... args)Deprecated.Creates an instance of the root resource class.static java.lang.reflect.Constructor<?>findJaxRsConstructor(java.lang.Class<?> jaxRsClass, java.lang.String rrcOrProvider)Deprecated.Finds the constructor to use by the JAX-RS runtime.(package private) static MethodgetHttpMethod(java.lang.reflect.Method javaMethod)Deprecated.Returns the HTTP method related to the given java method.static java.lang.StringgetValue(NamedValue<java.lang.String> namedValue)Deprecated.Returns the value from the given Parameter.static booleanisBeanSetter(java.lang.reflect.Method method, java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)Deprecated.Checks, if the given method is a bean setter and annotated with the given annotation.(package private) static booleanisVolatile(java.lang.reflect.Method javaMethod)Deprecated.Checks, if the method is volatile(the return type of a sub class differs from the return type of the superclass, but is compatibel).
-
-
-
Field Detail
-
JAX_RS_PACKAGE_PREFIX
private static final java.lang.String JAX_RS_PACKAGE_PREFIX
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
checkForJaxRsAnnotations
static boolean checkForJaxRsAnnotations(java.lang.reflect.Method javaMethod)
Deprecated.Checks, if the given annotation is annotated with at least one JAX-RS related annotation.- Parameters:
javaMethod- Java method, class or something like that.- Returns:
- true, if the given accessible object is annotated with any JAX-RS-Annotation.
-
checkParamAnnotations
private static boolean checkParamAnnotations(java.lang.reflect.Constructor<?> constr)
Deprecated.Checks if the parameters for the constructor are valid for a JAX-RS root resource class.- Parameters:
paramAnnotationss-parameterTypes-- Throws:
IllegalTypeException- If a parameter is annotated withContext, but the type is invalid (must be UriInfo, Request or HttpHeaders).
-
checkParameterAnnotation
private static boolean checkParameterAnnotation(java.lang.annotation.Annotation[] parameterAnnotations, java.lang.Class<?> parameterType)Deprecated.Checks, if the annotations are valid for a runtime environment handled constructor.- Parameters:
parameterAnnotations-parameterType-- Returns:
-
convertToMediaTypes
public static java.util.List<MediaType> convertToMediaTypes(java.lang.String[] mimes)
Deprecated.Converts the given mimes to a List of MediaTypes. Will never returns null.- Parameters:
mimes-- Returns:
- Returns an unmodifiable List of MediaTypes
-
createInstance
public static java.lang.Object createInstance(java.lang.reflect.Constructor<?> constructor, java.lang.Object... args) throws java.lang.reflect.InvocationTargetException, InstantiateExceptionDeprecated.Creates an instance of the root resource class.- Parameters:
constructor-args-- Returns:
- the created instance
- Throws:
java.lang.reflect.InvocationTargetExceptionInstantiateException
-
findJaxRsConstructor
public static java.lang.reflect.Constructor<?> findJaxRsConstructor(java.lang.Class<?> jaxRsClass, java.lang.String rrcOrProvider) throws MissingConstructorExceptionDeprecated.Finds the constructor to use by the JAX-RS runtime.- Parameters:
jaxRsClass- the root resource or provider class.rrcOrProvider- "root resource class" or "provider"- Returns:
- Returns the constructor to use for the given root resource class
or provider. If no constructor could be found, null is returned.
Than try
Class.newInstance() - Throws:
MissingConstructorException
-
getHttpMethod
static Method getHttpMethod(java.lang.reflect.Method javaMethod)
Deprecated.Returns the HTTP method related to the given java method.- Parameters:
javaMethod-- Returns:
-
getValue
public static java.lang.String getValue(NamedValue<java.lang.String> namedValue)
Deprecated.Returns the value from the given Parameter. If the given parameter is null, null will returned. If the parameter is not null, but it's value, "" is returned.- Parameters:
namedValue- The name/value string couple.- Returns:
- the value from the given Parameter. If the given parameter is null, null will returned. If the parameter is not null, but it's value, "" is returned.
-
isBeanSetter
public static boolean isBeanSetter(java.lang.reflect.Method method, java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass) throws java.lang.SecurityExceptionDeprecated.Checks, if the given method is a bean setter and annotated with the given annotation. If it is a bean setter, the accessible attribute of is set the method is set to true.- Parameters:
method-annotationClass-- Returns:
- true, if the method is a bean setter, or false if not
- Throws:
java.lang.SecurityException
-
isVolatile
static boolean isVolatile(java.lang.reflect.Method javaMethod)
Deprecated.Checks, if the method is volatile(the return type of a sub class differs from the return type of the superclass, but is compatibel).- Parameters:
javaMethod-- Returns:
- true, if the method is volatile, otherwise false.
-
-