public final class ResourceMethod extends Object implements ResourceModelComponent, Producing, Consuming, Suspendable, NameBound
| Modifier and Type | Class and Description |
|---|---|
static class |
ResourceMethod.Builder
Resource method model builder.
|
static class |
ResourceMethod.JaxrsType
Resource method classification based on the recognized JAX-RS
resource method types.
|
| 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.
|
List<? extends ResourceModelComponent> |
getComponents()
Should return all existing resource model sub-components.
|
List<MediaType> |
getConsumedTypes()
Get the consumed media types supported by the component.
|
String |
getHttpMethod()
Get the associated HTTP method.
|
Invocable |
getInvocable()
Get the invocable method model.
|
Collection<Class<? extends Annotation>> |
getNameBindings()
Get the collection of name bindings attached to this component.
|
Resource |
getParent()
Get the parent resource for this resource method model.
|
List<MediaType> |
getProducedTypes()
Get the produced media types supported by the component.
|
long |
getSuspendTimeout()
Get the suspend timeout value in the given
time unit. |
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 |
isSse()
Check whether the resource method will be producing Server-sent event stream.
|
boolean |
isSuspendDeclared()
Check if the component is marked for suspending.
|
String |
toString() |
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 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 List<MediaType> getConsumedTypes()
ConsuminggetConsumedTypes in interface Consumingpublic List<MediaType> getProducedTypes()
ProducinggetProducedTypes in interface Producingpublic long getSuspendTimeout()
Suspendabletime unit.getSuspendTimeout in interface Suspendablepublic 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 isSse()
true if the resource method produces Server-sent event stream, false otherwise.public boolean isManagedAsyncDeclared()
Suspendableexecutor service.isManagedAsyncDeclared in interface Suspendabletrue if the component is marked for managed asynchronous execution,
false otherwise.public 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 Collection<Class<? extends Annotation>> getNameBindings()
NameBoundgetNameBindings in interface NameBoundCopyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.