public final class ResourceMethod extends java.lang.Object implements ResourceModelComponent, Producing, Consuming, Suspendable, NameBound
| Modifier and Type | Class and Description |
|---|---|
static class |
ResourceMethod.Builder
Resource method model builder.
|
(package private) static class |
ResourceMethod.Data
Immutable resource method data.
|
static class |
ResourceMethod.JaxrsType
Resource method classification based on the recognized JAX-RS
resource method types.
|
| Modifier and Type | Field and Description |
|---|---|
private ResourceMethod.Data |
data |
private Resource |
parent |
| Constructor and Description |
|---|
ResourceMethod(Resource parent,
ResourceMethod.Data data)
Create new resource method model instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ResourceModelVisitor visitor)
A component should call the visitor back with an appropriate
visitor interface method to give it a chance to process.
|
java.util.List<? extends ResourceModelComponent> |
getComponents()
Should return all existing resource model sub-components.
|
java.util.List<javax.ws.rs.core.MediaType> |
getConsumedTypes()
Get the consumed media types supported by the component.
|
(package private) ResourceMethod.Data |
getData()
Get model data represented by this resource method.
|
java.lang.String |
getHttpMethod()
Get the associated HTTP method.
|
Invocable |
getInvocable()
Get the invocable method model.
|
java.util.Collection<java.lang.Class<? extends java.lang.annotation.Annotation>> |
getNameBindings()
Get the collection of name bindings attached to this component.
|
Resource |
getParent()
Get the parent resource for this resource method model.
|
java.util.List<javax.ws.rs.core.MediaType> |
getProducedTypes()
Get the produced media types supported by the component.
|
long |
getSuspendTimeout()
Get the suspend timeout value in the given
time unit. |
java.util.concurrent.TimeUnit |
getSuspendTimeoutUnit()
Get the suspend
timeout value time unit. |
ResourceMethod.JaxrsType |
getType()
Get the JAX-RS method type.
|
boolean |
isExtended()
Get the flag indicating whether the resource method is extended or is a core of exposed RESTful API.
|
boolean |
isManagedAsyncDeclared()
Check if the component is marked to be executed asynchronously by using
an internal Jersey
executor service. |
boolean |
isNameBound()
Check if the component is bound or not.
|
boolean |
isSuspendDeclared()
Check if the component is marked for suspending.
|
java.lang.String |
toString() |
(package private) static java.util.List<ResourceMethod> |
transform(Resource parent,
java.util.List<ResourceMethod.Data> list)
Transform a collection of resource method data into resource method models.
|
private final ResourceMethod.Data data
private final Resource parent
ResourceMethod(Resource parent, ResourceMethod.Data data)
parent - parent resource model.data - resource method model data.static java.util.List<ResourceMethod> transform(Resource parent, java.util.List<ResourceMethod.Data> list)
parent - parent resource model.list - resource method data collection.ResourceMethod.Data getData()
public Resource getParent()
May return null in case the resource method is not bound to an existing resource.
This is typical for resource method models returned directly from the
ResourceMethod.Builder.build() method.
null if there is no parent resource associated with the method.public ResourceMethod.JaxrsType getType()
public java.lang.String getHttpMethod()
May return null in case the method represents a sub-resource
locator.
null in case this method
represents a sub-resource locator.public Invocable getInvocable()
public boolean isExtended()
Extended resource model components are helper components that are not considered as a core of a
RESTful API. These can be for example OPTIONS resource methods
added by model processors
or application.wadl resource producing the WADL. Both resource are rather supportive
than the core of RESTful API.
If not set the resource will not be defined as extended by default.
true if the method is extended.ExtendedResourcepublic java.util.List<javax.ws.rs.core.MediaType> getConsumedTypes()
ConsuminggetConsumedTypes in interface Consumingpublic java.util.List<javax.ws.rs.core.MediaType> getProducedTypes()
ProducinggetProducedTypes in interface Producingpublic long getSuspendTimeout()
Suspendabletime unit.getSuspendTimeout in interface Suspendablepublic java.util.concurrent.TimeUnit getSuspendTimeoutUnit()
Suspendabletimeout value time unit.getSuspendTimeoutUnit in interface Suspendablepublic boolean isSuspendDeclared()
SuspendableisSuspendDeclared in interface Suspendabletrue if the component is marked for suspending,
false otherwise.public boolean isManagedAsyncDeclared()
Suspendableexecutor service.isManagedAsyncDeclared in interface Suspendabletrue if the component is marked for managed asynchronous execution,
false otherwise.public java.util.List<? extends ResourceModelComponent> getComponents()
ResourceModelComponentgetComponents in interface ResourceModelComponentpublic void accept(ResourceModelVisitor visitor)
ResourceModelComponentaccept in interface ResourceModelComponentvisitor - resource model visitor.public boolean isNameBound()
NameBoundisNameBound in interface NameBoundtrue if the component is bound, false otherwise.public java.util.Collection<java.lang.Class<? extends java.lang.annotation.Annotation>> getNameBindings()
NameBoundgetNameBindings in interface NameBoundpublic java.lang.String toString()
toString in class java.lang.Object