Class ResourceClass
- java.lang.Object
-
- org.restlet.ext.jaxrs.internal.wrappers.AbstractJaxRsWrapper
-
- org.restlet.ext.jaxrs.internal.wrappers.ResourceClass
-
- Direct Known Subclasses:
RootResourceClass
@Deprecated public class ResourceClass extends AbstractJaxRsWrapper
Deprecated.Will be removed in next minor release.Instances represents a root resource class. A Java class that uses JAX-RS annotations to implement a corresponding Web resource, see chapter 3 of JAX-RS specification
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<RemainingPath,java.util.Set<Method>>allowedMethodsDeprecated.Caches the allowed methods (unmodifiable) for given remainingParts.protected java.lang.Class<?>jaxRsClassDeprecated.private booleanleaveEncodedDeprecated.is true, if the resource class is annotated with @Path.private java.util.Collection<ResourceMethod>resourceMethodsDeprecated.The resource methods of this resource class.private java.util.Collection<ResourceMethodOrLocator>resourceMethodsAndLocatorsDeprecated.The resource methods and sub resource locators of this resource class.private java.util.Collection<SubResourceLocator>subResourceLocatorsDeprecated.The sub resource locators of this resource class.
-
Constructor Summary
Constructors Modifier Constructor Description (package private)ResourceClass(java.lang.Class<?> jaxRsClass, ThreadLocalizedContext tlContext, JaxRsProviders jaxRsProviders, ExtensionBackwardMapping extensionBackwardMapping, java.util.logging.Logger logger)Deprecated.Creates a new root resource class wrapper.protectedResourceClass(java.lang.Class<?> jaxRsClass, JaxRsProviders jaxRsProviders, ThreadLocalizedContext tlContext, ExtensionBackwardMapping extensionBackwardMapping, java.util.logging.Logger logger)Deprecated.Creates a new root resource class wrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private voidcheckForPrimitiveParameters(java.lang.reflect.Method execMethod, java.util.logging.Logger logger)Deprecated.Warn, if one of the message parameters is primitive.booleanequals(java.lang.Object anotherObject)Deprecated.java.util.Set<Method>getAllowedMethods(RemainingPath remainingPath)Deprecated.Returns the allowed methods on the remainingPart.private java.lang.reflect.MethodgetAnnotatedJavaMethod(java.lang.reflect.Method javaMethod)Deprecated.Returns the method with the annotations, corresponding to the given method.java.lang.Class<?>getJaxRsClass()Deprecated.private java.lang.reflect.MethodgetMethodFromClass(java.lang.Class<?> clazz, java.lang.reflect.Method subClassMethod)Deprecated.Looks for the method with the same signature as the given method in the given class.java.util.Collection<ResourceMethod>getMethodsForPath(RemainingPath remainingPath)Deprecated.Return all resource methods for the given path, ignoring HTTP method, consumed or produced mimes and so on.java.lang.StringgetName()Deprecated.java.lang.Iterable<ResourceMethod>getResourceMethods()Deprecated.java.util.Collection<ResourceMethodOrLocator>getResourceMethodsAndLocators()Deprecated.java.lang.Iterable<SubResourceLocator>getSubResourceLocators()Deprecated.inthashCode()Deprecated.booleanhasSubResourceMethodsOrLocators()Deprecated.private voidinitResourceMethodsAndLocators(ThreadLocalizedContext tlContext, JaxRsProviders jaxRsProviders, ExtensionBackwardMapping extensionBackwardMapping, java.util.logging.Logger logger)Deprecated.(package private) booleanisLeaveEncoded()Deprecated.java.lang.StringtoString()Deprecated.-
Methods inherited from class org.restlet.ext.jaxrs.internal.wrappers.AbstractJaxRsWrapper
getPathRegExp
-
-
-
-
Field Detail
-
allowedMethods
private final java.util.Map<RemainingPath,java.util.Set<Method>> allowedMethods
Deprecated.Caches the allowed methods (unmodifiable) for given remainingParts.
-
jaxRsClass
protected final java.lang.Class<?> jaxRsClass
Deprecated.
-
leaveEncoded
private final boolean leaveEncoded
Deprecated.is true, if the resource class is annotated with @Path. Is available after constructor was running.
-
resourceMethods
private final java.util.Collection<ResourceMethod> resourceMethods
Deprecated.The resource methods of this resource class. (It is initialized in method.)initResourceMethodsAndLocators(ThreadLocalizedContext, JaxRsProviders, ExtensionBackwardMapping, Logger)
-
resourceMethodsAndLocators
private final java.util.Collection<ResourceMethodOrLocator> resourceMethodsAndLocators
Deprecated.The resource methods and sub resource locators of this resource class. (It is initialized in method.)initResourceMethodsAndLocators(ThreadLocalizedContext, JaxRsProviders, ExtensionBackwardMapping, Logger)
-
subResourceLocators
private final java.util.Collection<SubResourceLocator> subResourceLocators
Deprecated.The sub resource locators of this resource class. (It is initialized in method.)initResourceMethodsAndLocators(ThreadLocalizedContext, JaxRsProviders, ExtensionBackwardMapping, Logger)
-
-
Constructor Detail
-
ResourceClass
protected ResourceClass(java.lang.Class<?> jaxRsClass, JaxRsProviders jaxRsProviders, ThreadLocalizedContext tlContext, ExtensionBackwardMapping extensionBackwardMapping, java.util.logging.Logger logger) throws java.lang.IllegalArgumentException, IllegalPathOnClassException, MissingAnnotationExceptionDeprecated.Creates a new root resource class wrapper. To be used by subclassRootResourceClass.- Parameters:
jaxRsClass-jaxRsProviders- all entity providerstlContext- theThreadLocalizedContextof theJaxRsRestlet.extensionBackwardMapping- the extension backward mappinglogger-- Throws:
java.lang.IllegalArgumentExceptionIllegalPathOnClassExceptionMissingAnnotationException- if @Pathis missing on the jaxRsClass- See Also:
ResourceClasses.getResourceClass(Class)
-
ResourceClass
ResourceClass(java.lang.Class<?> jaxRsClass, ThreadLocalizedContext tlContext, JaxRsProviders jaxRsProviders, ExtensionBackwardMapping extensionBackwardMapping, java.util.logging.Logger logger) throws java.lang.IllegalArgumentException, MissingAnnotationExceptionDeprecated.Creates a new root resource class wrapper. Will not set the path, because it is not available for a normal resource class.- Parameters:
jaxRsClass-tlContext- theThreadLocalizedContextof theJaxRsRestlet.jaxRsProviders- all entity providersextensionBackwardMapping- the extension backward mappinglogger- The logger to log warnings, if the class is not valid.- Throws:
MissingAnnotationExceptionjava.lang.IllegalArgumentException- See Also:
ResourceClasses.getResourceClass(Class)
-
-
Method Detail
-
checkForPrimitiveParameters
private void checkForPrimitiveParameters(java.lang.reflect.Method execMethod, java.util.logging.Logger logger)Deprecated.Warn, if one of the message parameters is primitive.- Parameters:
execMethod-logger-
-
equals
public boolean equals(java.lang.Object anotherObject)
Deprecated.- Overrides:
equalsin classjava.lang.Object
-
getAllowedMethods
public java.util.Set<Method> getAllowedMethods(RemainingPath remainingPath)
Deprecated.Returns the allowed methods on the remainingPart. This method is used for a OPTIONS request, if no special java method in the root resource class was found for the given remainingPart.- Parameters:
remainingPath-- Returns:
- an unmodifiable
Setof the allowed methods.
-
getAnnotatedJavaMethod
private java.lang.reflect.Method getAnnotatedJavaMethod(java.lang.reflect.Method javaMethod)
Deprecated.Returns the method with the annotations, corresponding to the given method. If the given method contains any JAX-RS annotations, it is returned. If it is not annotated with JAX-RS annotations, this method looks recursive in the subclass and the implemented interfaces, until it found one. This would be returned.- Parameters:
javaMethod- The java method to look for annotations- Returns:
- the founded method, or null, if no method with annotations was found. Returns also null, if null was given.
-
getJaxRsClass
public final java.lang.Class<?> getJaxRsClass()
Deprecated.- Returns:
- Returns the wrapped root resource class.
-
getMethodFromClass
private java.lang.reflect.Method getMethodFromClass(java.lang.Class<?> clazz, java.lang.reflect.Method subClassMethod)Deprecated.Looks for the method with the same signature as the given method in the given class.- Parameters:
clazz- The Class to look for the method.subClassMethod- the Method to look for it's signature in the given class.- Returns:
- the method in the given class, with the same signature as given method, or null if such method is not available. Returns also null, if the given class is null.
-
getMethodsForPath
public java.util.Collection<ResourceMethod> getMethodsForPath(RemainingPath remainingPath)
Deprecated.Return all resource methods for the given path, ignoring HTTP method, consumed or produced mimes and so on.- Parameters:
resourceObject- The resource objectremainingPath- the path- Returns:
- The ist of ResourceMethods
-
getName
public java.lang.String getName()
Deprecated.- Returns:
- returns the name of the wrapped class
-
getResourceMethods
public final java.lang.Iterable<ResourceMethod> getResourceMethods()
Deprecated.- Returns:
- Return the sub resource methods of the given class.
-
getResourceMethodsAndLocators
public final java.util.Collection<ResourceMethodOrLocator> getResourceMethodsAndLocators()
Deprecated.- Returns:
- Returns the sub resource locatores and sub resource methods.
-
getSubResourceLocators
public final java.lang.Iterable<SubResourceLocator> getSubResourceLocators()
Deprecated.- Returns:
- Returns the sub resource locators of the given class.
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCodein classjava.lang.Object
-
hasSubResourceMethodsOrLocators
public final boolean hasSubResourceMethodsOrLocators()
Deprecated.- Returns:
- Returns true if the wrapped resource class has sub resource methods or sub resource locators.
-
initResourceMethodsAndLocators
private void initResourceMethodsAndLocators(ThreadLocalizedContext tlContext, JaxRsProviders jaxRsProviders, ExtensionBackwardMapping extensionBackwardMapping, java.util.logging.Logger logger) throws java.lang.IllegalArgumentException, MissingAnnotationException
Deprecated.- Throws:
java.lang.IllegalArgumentExceptionMissingAnnotationException
-
isLeaveEncoded
boolean isLeaveEncoded()
Deprecated.- Returns:
- the leaveEncoded
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toStringin classjava.lang.Object
-
-