public class AbstractResourceDescriptorImpl extends BaseObjectModel implements AbstractResourceDescriptor
clazz, constructors, fields, properties| Constructor and Description |
|---|
AbstractResourceDescriptorImpl(Class<?> resourceClass)
Constructs new instance of AbstractResourceDescriptor.
|
AbstractResourceDescriptorImpl(Object resource)
Constructs new instance of AbstractResourceDescriptor.
|
AbstractResourceDescriptorImpl(String path,
Class<?> resourceClass) |
AbstractResourceDescriptorImpl(String path,
Object resource) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ResourceDescriptorVisitor visitor)
Method is useful for validation.
|
protected List<MethodParameter> |
createMethodParametersList(Class<?> resourceClass,
Method method)
Create list of
MethodParameter . |
protected <T extends ResourceMethodDescriptor> |
findMethodResourceMediaType(List<T> resourceMethods,
List<javax.ws.rs.core.MediaType> consumes,
List<javax.ws.rs.core.MediaType> produces)
Check is collection of
ResourceMethodDescriptor already contains ResourceMethodDescriptor with
the
same
media types. |
protected <T extends Annotation> |
getClassAnnotation(Class<?> resourceClass,
Class<T> annotationClass)
Tries to get JAX-RS annotation on class, superclasses or implemented interfaces.
|
protected <T extends Annotation> |
getMetaAnnotation(Method m,
Class<T> annotationClass)
Get all method with at least one annotation which has annotation annotation.
|
protected <T extends Annotation> |
getMethodAnnotation(Method method,
Class<?> resourceClass,
Class<T> annotationClass,
boolean metaAnnotation)
Tries to get JAX-RS annotation on method from the resource class's superclasses or implemented interfaces.
|
PathValue |
getPathValue() |
ResourceMethodMap<ResourceMethodDescriptor> |
getResourceMethods() |
SubResourceLocatorMap |
getSubResourceLocators() |
SubResourceMethodMap |
getSubResourceMethods() |
UriPattern |
getUriPattern() |
boolean |
isRootResource() |
protected void |
processMethods()
Process method of resource and separate them to three types Resource Methods, Sub-Resource Methods and
Sub-Resource Locators.
|
protected void |
resolveHeadRequest()
According to JSR-311:
On receipt of a HEAD request an implementation MUST either: 1.
|
protected void |
resolveOptionsRequest()
According to JSR-311:
On receipt of a OPTIONS request an implementation MUST either: 1.
|
String |
toString() |
getConstructorDescriptors, getFieldInjectors, getObjectClass, getProperties, getProperty, processConstructors, processFieldsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetConstructorDescriptors, getFieldInjectors, getObjectClass, getProperties, getPropertypublic AbstractResourceDescriptorImpl(Class<?> resourceClass)
resourceClass - resource classpublic AbstractResourceDescriptorImpl(String path, Class<?> resourceClass)
public AbstractResourceDescriptorImpl(Object resource)
resource - resourcepublic void accept(ResourceDescriptorVisitor visitor)
ResourceDescriptoraccept in interface ResourceDescriptorvisitor - See ResourceDescriptorVisitorpublic PathValue getPathValue()
getPathValue in interface AbstractResourceDescriptorPathValuepublic ResourceMethodMap<ResourceMethodDescriptor> getResourceMethods()
getResourceMethods in interface AbstractResourceDescriptorResourceMethodDescriptorpublic SubResourceLocatorMap getSubResourceLocators()
getSubResourceLocators in interface AbstractResourceDescriptorSubResourceLocatorDescriptorpublic SubResourceMethodMap getSubResourceMethods()
getSubResourceMethods in interface AbstractResourceDescriptorSubResourceMethodDescriptorpublic UriPattern getUriPattern()
getUriPattern in interface AbstractResourceDescriptorUriPatternpublic boolean isRootResource()
isRootResource in interface AbstractResourceDescriptorPath annotationprotected void processMethods()
protected List<MethodParameter> createMethodParametersList(Class<?> resourceClass, Method method)
MethodParameter .resourceClass - classmethod - See MethodMethodParameterprotected void resolveHeadRequest()
On receipt of a HEAD request an implementation MUST either: 1. Call method annotated with request method designation for HEAD or, if none present, 2. Call method annotated with a request method designation GET and discard any returned entity.
protected void resolveOptionsRequest()
On receipt of a OPTIONS request an implementation MUST either: 1. Call method annotated with request method designation for OPTIONS or, if none present, 2. Generate an automatic response using the metadata provided by the JAX-RS annotations on the matching class and its methods.
protected <T extends Annotation> T getMetaAnnotation(Method m, Class<T> annotationClass)
GET, etc. All HTTP method annotations has annotation HttpMethod.T - annotation typem - methodannotationClass - annotation classprotected <T extends Annotation> T getMethodAnnotation(Method method, Class<?> resourceClass, Class<T> annotationClass, boolean metaAnnotation)
T - annotation typemethod - method for discoveringresourceClass - class that contains discovered methodannotationClass - annotation type what we are looking formetaAnnotation - false if annotation should be on method and true in method should contain annotations that
has supplied annotationprotected <T extends Annotation> T getClassAnnotation(Class<?> resourceClass, Class<T> annotationClass)
protected <T extends ResourceMethodDescriptor> ResourceMethodDescriptor findMethodResourceMediaType(List<T> resourceMethods, List<javax.ws.rs.core.MediaType> consumes, List<javax.ws.rs.core.MediaType> produces)
ResourceMethodDescriptor already contains ResourceMethodDescriptor with
the
same
media types.resourceMethods - Set of ResourceMethodDescriptorconsumes - resource method consumed media typeproduces - resource method produced media typeCopyright © 2015. All rights reserved.