|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.ws.rs.core.Application com.sun.jersey.api.core.ResourceConfig com.sun.jersey.api.core.DefaultResourceConfig
public class DefaultResourceConfig
A mutable implementation of ResourceConfig
that declares
default values for features.
The set of features and properties may be modified by modifying the instances
returned from the methods ResourceConfig.getFeatures()
and
ResourceConfig.getProperties()
respectively.
Field Summary |
---|
Fields inherited from interface com.sun.jersey.core.util.FeaturesAndProperties |
---|
FEATURE_DISABLE_XML_SECURITY, FEATURE_FORMATTED, FEATURE_PRE_1_4_PROVIDER_PRECEDENCE, FEATURE_XMLROOTELEMENT_PROCESSING |
Constructor Summary | |
---|---|
DefaultResourceConfig()
|
|
DefaultResourceConfig(java.lang.Class<?>... classes)
|
|
DefaultResourceConfig(java.util.Set<java.lang.Class<?>> classes)
|
Method Summary | |
---|---|
java.util.Set<java.lang.Class<?>> |
getClasses()
Get a set of root resource and provider classes. |
java.util.Map<java.lang.String,java.lang.Object> |
getExplicitRootResources()
Get a map of explicit root resource classes and root resource singleton instances. |
boolean |
getFeature(java.lang.String featureName)
Get the value of a feature. |
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,MediaType> |
getMediaTypeMappings()
Get a map of file extension to media type. |
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Get the map of properties associated with the Web application. |
java.lang.Object |
getProperty(java.lang.String propertyName)
Get the value of a property. |
java.util.Set<java.lang.Object> |
getSingletons()
Get a set of root resource and provider instances. |
Methods inherited from class com.sun.jersey.api.core.ResourceConfig |
---|
add, clone, getContainerRequestFilters, getContainerResponseFilters, getElements, getElements, getProviderClasses, getProviderSingletons, getResourceFilterFactories, getRootResourceClasses, getRootResourceSingletons, isProviderClass, isRootResourceClass, setPropertiesAndFeatures, validate |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultResourceConfig()
public DefaultResourceConfig(java.lang.Class<?>... classes)
classes
- the initial set of root resource classes
and provider classespublic DefaultResourceConfig(java.util.Set<java.lang.Class<?>> classes)
classes
- the initial set of root resource classes
and provider classesMethod Detail |
---|
public java.util.Set<java.lang.Class<?>> getClasses()
Application
Implementations should warn about and ignore classes that do not
conform to the requirements of root resource or provider classes.
Implementations should warn about and ignore classes for which
Application.getSingletons()
returns an instance. Implementations MUST
NOT modify the returned set.
The default implementation returns an empty set.
getClasses
in class Application
public java.util.Set<java.lang.Object> getSingletons()
Application
Context
) by the runtime prior to use.
Implementations should warn about and ignore classes that do not conform to the requirements of root resource or provider classes. Implementations should flag an error if the returned set includes more than one instance of the same class. Implementations MUST NOT modify the returned set.
The default implementation returns an empty set.
getSingletons
in class Application
public java.util.Map<java.lang.String,MediaType> getMediaTypeMappings()
ResourceConfig
GET /resource.atom
is equivalent to:
GET /resource Accept: application/atom+xml
The default implementation returns an empty map.
getMediaTypeMappings
in class ResourceConfig
public java.util.Map<java.lang.String,java.lang.String> getLanguageMappings()
ResourceConfig
GET /resource.english
is equivalent to:
GET /resource Accept-Language: en
The default implementation returns an empty map.
getLanguageMappings
in class ResourceConfig
public java.util.Map<java.lang.String,java.lang.Object> getExplicitRootResources()
ResourceConfig
The root resource path template is declared using the key in the map. This
is a substitute for the declaration of a Path
annotation on a root
resource class or singleton instance. The key has the same semantics as the
Path.value()
. If such a Path
annotation is present
it will be ignored.
For example, the following will register two root resources, first a root resource class at the path "class" and a root resource singleton at the path "singleton":
getExplicitRootResources().put("class", RootResourceClass.class); getExplicitRootResources().put("singleton", new RootResourceSingleton());
getExplicitRootResources
in class ResourceConfig
public java.util.Map<java.lang.String,java.lang.Boolean> getFeatures()
ResourceConfig
getFeatures
in interface FeaturesAndProperties
getFeatures
in class ResourceConfig
public boolean getFeature(java.lang.String featureName)
ResourceConfig
getFeature
in interface FeaturesAndProperties
getFeature
in class ResourceConfig
featureName
- the feature name.
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
ResourceConfig
getProperties
in interface FeaturesAndProperties
getProperties
in class ResourceConfig
public java.lang.Object getProperty(java.lang.String propertyName)
ResourceConfig
getProperty
in interface FeaturesAndProperties
getProperty
in class ResourceConfig
propertyName
- the property name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |