public class DefaultResourceConfig extends ResourceConfig
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.
COMMON_DELIMITERS, FEATURE_CANONICALIZE_URI_PATH, FEATURE_DISABLE_WADL, FEATURE_IMPLICIT_VIEWABLES, FEATURE_MATCH_MATRIX_PARAMS, FEATURE_NORMALIZE_URI, FEATURE_REDIRECT, FEATURE_TRACE, FEATURE_TRACE_PER_REQUEST, PROPERTY_CONTAINER_NOTIFIER, PROPERTY_CONTAINER_REQUEST_FILTERS, PROPERTY_CONTAINER_RESPONSE_FILTERS, PROPERTY_DEFAULT_RESOURCE_COMPONENT_PROVIDER_FACTORY_CLASS, PROPERTY_LANGUAGE_MAPPINGS, PROPERTY_MEDIA_TYPE_MAPPINGS, PROPERTY_RESOURCE_FILTER_FACTORIES, PROPERTY_WADL_GENERATOR_CONFIG
FEATURE_DISABLE_XML_SECURITY, FEATURE_FORMATTED, FEATURE_PRE_1_4_PROVIDER_PRECEDENCE, FEATURE_XMLROOTELEMENT_PROCESSING
Constructor and Description |
---|
DefaultResourceConfig() |
DefaultResourceConfig(Class<?>... classes) |
DefaultResourceConfig(Set<Class<?>> classes) |
Modifier and Type | Method and Description |
---|---|
Set<Class<?>> |
getClasses() |
Map<String,Object> |
getExplicitRootResources()
Get a map of explicit root resource classes and root resource singleton
instances.
|
boolean |
getFeature(String featureName)
Get the value of a feature.
|
Map<String,Boolean> |
getFeatures()
Get the map of features associated with the Web application.
|
Map<String,String> |
getLanguageMappings()
Get a map of file extension to language.
|
Map<String,javax.ws.rs.core.MediaType> |
getMediaTypeMappings()
Get a map of file extension to media type.
|
Map<String,Object> |
getProperties()
Get the map of properties associated with the Web application.
|
Object |
getProperty(String propertyName)
Get the value of a property.
|
Set<Object> |
getSingletons() |
add, clone, getContainerRequestFilters, getContainerResponseFilters, getElements, getElements, getProviderClasses, getProviderSingletons, getResourceFilterFactories, getRootResourceClasses, getRootResourceSingletons, isProviderClass, isRootResourceClass, setPropertiesAndFeatures, validate
public DefaultResourceConfig()
public DefaultResourceConfig(Class<?>... classes)
classes
- the initial set of root resource classes
and provider classespublic Set<Class<?>> getClasses()
getClasses
in class javax.ws.rs.core.Application
public Set<Object> getSingletons()
getSingletons
in class javax.ws.rs.core.Application
public Map<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 Map<String,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 Map<String,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 Map<String,Boolean> getFeatures()
ResourceConfig
getFeatures
in interface FeaturesAndProperties
getFeatures
in class ResourceConfig
public boolean getFeature(String featureName)
ResourceConfig
getFeature
in interface FeaturesAndProperties
getFeature
in class ResourceConfig
featureName
- the feature name.public Map<String,Object> getProperties()
ResourceConfig
getProperties
in interface FeaturesAndProperties
getProperties
in class ResourceConfig
public Object getProperty(String propertyName)
ResourceConfig
getProperty
in interface FeaturesAndProperties
getProperty
in class ResourceConfig
propertyName
- the property name.Copyright © 2013 Oracle Corporation. All rights reserved.