public interface ResourceBinder
| Modifier and Type | Method and Description |
|---|---|
void |
addResource(Class<?> resourceClass,
javax.ws.rs.core.MultivaluedMap<String,String> properties)
Register supplied class as per-request root resource if it has valid
JAX-RS annotations and no one resource with the same UriPattern already
registered.
|
void |
addResource(ObjectFactory<AbstractResourceDescriptor> resourceFactory)
Register supplied root resource if no one resource with the same
UriPattern already registered.
|
void |
addResource(Object resource,
javax.ws.rs.core.MultivaluedMap<String,String> properties)
Register supplied Object as singleton root resource if it has valid JAX-RS
annotations and no one resource with the same UriPattern already
registered.
|
void |
addResource(String uriPattern,
Class<?> resourceClass,
javax.ws.rs.core.MultivaluedMap<String,String> properties)
Register supplied class as per-request root resource if it has valid JAX-RS annotations and no one resource with the same
uriPattern already registered. |
void |
addResource(String uriPattern,
Object resource,
javax.ws.rs.core.MultivaluedMap<String,String> properties)
Register supplied object as singleton root resource if it has valid JAX-RS annotations and no one resource with the same
uriPattern already registered. |
ObjectFactory<AbstractResourceDescriptor> |
getMatchedResource(String requestPath,
List<String> parameterValues)
Get root resource matched to
requestPath. |
List<ObjectFactory<AbstractResourceDescriptor>> |
getResources()
Get list of all registered root resources.
|
int |
getSize() |
ObjectFactory<AbstractResourceDescriptor> |
removeResource(Class<?> clazz)
Remove root resource of supplied class from root resource collection.
|
ObjectFactory<AbstractResourceDescriptor> |
removeResource(String path)
Remove root resource with specified UriTemplate from root resource
collection.
|
List<ObjectFactory<AbstractResourceDescriptor>> getResources()
int getSize()
void addResource(Class<?> resourceClass, javax.ws.rs.core.MultivaluedMap<String,String> properties)
resourceClass - class of candidate to be root resourceproperties - optional resource properties. It may contains additional
info about resource, e.g. description of resource, its
responsibility, etc. This info can be retrieved
ObjectModel.getProperties(). This parameter may be
nullResourcePublicationException - if resource can't be published
because to:
UriPattern already
registeredObjectModel.getProperties(),
ObjectModel.getProperty(String)void addResource(String uriPattern, Class<?> resourceClass, javax.ws.rs.core.MultivaluedMap<String,String> properties)
uriPattern already registered. Resource class doesn't need to be annotated with @Path annotation (but may be).
Anyway uriPattern parameter overwrites value of @Path annotation.uriPattern - class of candidate to be root resourceresourceClass - class of candidate to be root resourceproperties - optional resource properties. It may contains additional
info about resource, e.g. description of resource, its
responsibility, etc. This info can be retrieved
ObjectModel.getProperties(). This parameter may be
nullResourcePublicationException - if resource can't be published
because to:
uriPattern is null or emptyUriPattern already
registeredObjectModel.getProperties(),
ObjectModel.getProperty(String)void addResource(Object resource, javax.ws.rs.core.MultivaluedMap<String,String> properties)
resource - candidate to be root resourceproperties - optional resource properties. It may contains additional
info about resource, e.g. description of resource, its
responsibility, etc. This info can be retrieved
ObjectModel.getProperties(). This parameter may be
nullResourcePublicationException - if resource can't be published
because to:
UriPattern already
registeredObjectModel.getProperties(),
ObjectModel.getProperty(String)void addResource(String uriPattern, Object resource, javax.ws.rs.core.MultivaluedMap<String,String> properties)
uriPattern already registered. Resource class doesn't need to be annotated with @Path annotation (but may be).
Anyway uriPattern parameter overwrite value of @Path annotation.resource - candidate to be root resourceproperties - optional resource properties. It may contains additional
info about resource, e.g. description of resource, its
responsibility, etc. This info can be retrieved
ObjectModel.getProperties(). This parameter may be
nullResourcePublicationException - if resource can't be published
because to:
uriPattern is null or emptyUriPattern already
registeredObjectModel.getProperties(),
ObjectModel.getProperty(String)void addResource(ObjectFactory<AbstractResourceDescriptor> resourceFactory)
resourceFactory - root resourceResourcePublicationException - if resource can't be published
because resource with the sane UriPattern already
registeredObjectFactory<AbstractResourceDescriptor> getMatchedResource(String requestPath, List<String> parameterValues)
requestPath.requestPath - request pathparameterValues - see ApplicationContext.getParameterValues()requestPath or
nullObjectFactory<AbstractResourceDescriptor> removeResource(Class<?> clazz)
clazz - root resource classnull if resource of specified
class not foundObjectFactory<AbstractResourceDescriptor> removeResource(String path)
path - root resource pathnull if resource for specified
template not foundCopyright © 2012–2016 Codenvy, S.A.. All rights reserved.