|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.ws.rs.core.Application
com.sun.jersey.api.core.ResourceConfig
public abstract class ResourceConfig
The resource configuration for configuring a web application.
Field Summary | |
---|---|
static java.lang.String |
FEATURE_CANONICALIZE_URI_PATH
If true the request URI path component will be canonicalized by removing contiguous slashes (i.e. |
static java.lang.String |
FEATURE_IMPLICIT_VIEWABLES
If true then the matching algorithm will attempt to match and accept any static content or templates associated with a resource that were not explicitly decared by that resource. |
static java.lang.String |
FEATURE_MATCH_MATRIX_PARAMS
If true matrix parameters (if present) in the request URI path component will be ignored when matching the path to URI templates declared by resource classes. |
static java.lang.String |
FEATURE_NORMALIZE_URI
If true the request URI will be normalized as specified by URI.normalize() . |
static java.lang.String |
FEATURE_REDIRECT
If true, and either NORMALIZE_URI or CANONICALIZE_URI_PATH is true, and the normalization and/or path canonicalization operations on the request URI result in a new URI that is not equal to the request URI, then the client is (temporarily) redirected to the new URI. |
static java.lang.String |
PROPERTY_CONTAINER_NOTIFIER
If set the instance of ContainerNotifier to register
ContainerListener instances. |
static java.lang.String |
PROPERTY_CONTAINER_REQUEST_FILTERS
If set the list of ContainerRequestFilter that are applied
to filter the request. |
static java.lang.String |
PROPERTY_CONTAINER_RESPONSE_FILTERS
If set the list of ContainerResponseFilter that are applied
to filter the response. |
static java.lang.String |
PROPERTY_DEFAULT_RESOURCE_PROVIDER_CLASS
If set the default resource provider to be used by the ResourceProviderFactory . |
static java.lang.String |
PROPERTY_WADL_GENERATOR_CONFIG
If set the wadl generator configuration that provides that WadlGenerator
to be used by the WadlFactory . |
Constructor Summary | |
---|---|
ResourceConfig()
|
Method Summary | |
---|---|
abstract boolean |
getFeature(java.lang.String featureName)
Get the value of a feature. |
abstract java.util.Map<java.lang.String,java.lang.Boolean> |
getFeatures()
Get the map of features associated with the Web application. |
java.util.Map<java.lang.String,java.lang.String> |
getLanguageMappings()
Get a map of file extension to language. |
java.util.Map<java.lang.String,javax.ws.rs.core.MediaType> |
getMediaTypeMappings()
Get a map of file extension to media type. |
abstract java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Get the map of properties associated with the Web application. |
abstract java.lang.Object |
getProperty(java.lang.String propertyName)
Get the value of a property. |
java.util.Set<java.lang.Class<?>> |
getProviderClasses()
Get the set of provider classes. |
java.util.Set<java.lang.Object> |
getProviderSingletons()
Get the set of provider singleton instances. |
java.util.Set<java.lang.Class<?>> |
getRootResourceClasses()
Get the set of root resource classes. |
java.util.Set<java.lang.Object> |
getRootResourceSingletons()
Get the set of root resource singleton instances. |
void |
validate()
Validate the set of classes and singletons. |
Methods inherited from class javax.ws.rs.core.Application |
---|
getClasses, getSingletons |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FEATURE_NORMALIZE_URI
URI.normalize()
. If not true the request URI is not
modified.
The default value is false.
public static final java.lang.String FEATURE_CANONICALIZE_URI_PATH
The default value is false.
public static final java.lang.String FEATURE_REDIRECT
If true, and the path value of a Path
annotation ends
in a slash, the request URI path does not end in a '/' and would otherwise
match the path value if it did, then the client is (temporarily)
redirected to a new URI that is the request URI with a '/' appended to the
the end of the path.
The default value is false.
public static final java.lang.String FEATURE_MATCH_MATRIX_PARAMS
The default value is false.
public static final java.lang.String FEATURE_IMPLICIT_VIEWABLES
If a template is matched then the model for the viewable will be the resource instance associated with the template.
The default value is false.
public static final java.lang.String PROPERTY_DEFAULT_RESOURCE_PROVIDER_CLASS
ResourceProviderFactory
.
The type of this property must be a Java class that implementations
ResourceProvider
.
If not set the default resource provider will be the per-request resource provider
public static final java.lang.String PROPERTY_CONTAINER_NOTIFIER
ContainerNotifier
to register
ContainerListener
instances.
If the instance does not implement the ContainerNotifier
then the property is ignored.
public static final java.lang.String PROPERTY_CONTAINER_REQUEST_FILTERS
ContainerRequestFilter
that are applied
to filter the request. The filters are applied in order form
first to last as declared.
The instance may be a String[] or String that contains one or more fully qualified class name of a request filter class separeted by ';'. Otherwise the instance may be List<ContainerRequestFilter>.
public static final java.lang.String PROPERTY_CONTAINER_RESPONSE_FILTERS
ContainerResponseFilter
that are applied
to filter the response. The filters are applied in order form
first to last as declared.
The instance may be a String[] or String that contains one or more fully qualified class name of a response filter class separeted by ';'. Otherwise the instance may be List<ContainerResponseFilter>.
public static final java.lang.String PROPERTY_WADL_GENERATOR_CONFIG
WadlGenerator
to be used by the WadlFactory
.
The type of this property must be a subclass or an instance of a subclass of
WadlGeneratorConfig
.
If this property is not set the default wadl generator will be used for generating wadl.
Constructor Detail |
---|
public ResourceConfig()
Method Detail |
---|
public abstract java.util.Map<java.lang.String,java.lang.Boolean> getFeatures()
public abstract boolean getFeature(java.lang.String featureName)
featureName
- the feature name.
public abstract java.util.Map<java.lang.String,java.lang.Object> getProperties()
public abstract java.lang.Object getProperty(java.lang.String propertyName)
propertyName
- the property name.
public java.util.Map<java.lang.String,javax.ws.rs.core.MediaType> getMediaTypeMappings()
GET /resource.atom
is equivalent to:
GET /resource Accept: application/atom+xml
The default implementation returns an empty map.
public java.util.Map<java.lang.String,java.lang.String> getLanguageMappings()
GET /resource.english
is equivalent to:
GET /resource Accept-Language: en
The default implementation returns an empty map.
public void validate()
A registered class is removed from the set of registered classes if an instance of that class is a member of the set of registered singletons.
A registered class that is an interface of an abstract class is removed from the registered classes.
java.lang.IllegalArgumentException
- if the set of registered singletons
contains more than one instance of the same root resource class.public java.util.Set<java.lang.Class<?>> getRootResourceClasses()
A root resource class is a registered class that is annotated with Path.
public java.util.Set<java.lang.Class<?>> getProviderClasses()
A provider class is a registered class that is not annotated with Path.
public java.util.Set<java.lang.Object> getRootResourceSingletons()
A root resource singleton instance is a registered instance whose class is annotated with Path.
public java.util.Set<java.lang.Object> getProviderSingletons()
A provider singleton instances is a registered instance whose class is not annotated with Path.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |