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.ExtendedResource
public List<MediaType> getConsumedTypes()
Consuming
getConsumedTypes
in interface Consuming
public List<MediaType> getProducedTypes()
Producing
getProducedTypes
in interface Producing
public long getSuspendTimeout()
Suspendable
time unit
.getSuspendTimeout
in interface Suspendable
public TimeUnit getSuspendTimeoutUnit()
Suspendable
timeout value
time unit.getSuspendTimeoutUnit
in interface Suspendable
public boolean isSuspendDeclared()
Suspendable
isSuspendDeclared
in interface Suspendable
true
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()
Suspendable
executor service
.isManagedAsyncDeclared
in interface Suspendable
true
if the component is marked for managed asynchronous execution,
false
otherwise.public List<? extends ResourceModelComponent> getComponents()
ResourceModelComponent
getComponents
in interface ResourceModelComponent
public void accept(ResourceModelVisitor visitor)
ResourceModelComponent
accept
in interface ResourceModelComponent
visitor
- resource model visitor.public boolean isNameBound()
NameBound
isNameBound
in interface NameBound
true
if the component is bound, false
otherwise.public Collection<Class<? extends Annotation>> getNameBindings()
NameBound
getNameBindings
in interface NameBound
Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.