|
||||||||||
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
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 |
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()
|
static java.lang.String[] |
getElements(java.lang.String[] elements)
Get a cannonical array of String elements from a String array where each entry may contain zero or more elements separated by ';'. |
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,javax.ws.rs.core.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()
|
Methods inherited from class com.sun.jersey.api.core.ResourceConfig |
---|
add, clone, getContainerRequestFilters, getContainerResponseFilters, 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()
getClasses
in class javax.ws.rs.core.Application
public java.util.Set<java.lang.Object> getSingletons()
getSingletons
in class javax.ws.rs.core.Application
public java.util.Map<java.lang.String,javax.ws.rs.core.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.
public static java.lang.String[] getElements(java.lang.String[] elements)
elements
- an array where each String entry may contain zero or more
';' separated elements.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |