com.sun.jersey.api.core
Class DefaultResourceConfig

java.lang.Object  extended by javax.ws.rs.core.Application      extended by com.sun.jersey.api.core.ResourceConfig          extended by com.sun.jersey.api.core.DefaultResourceConfig
All Implemented Interfaces:
FeaturesAndProperties
Direct Known Subclasses:
ApplicationAdapter, ClassNamesResourceConfig, ScanningResourceConfig

public class DefaultResourceConfig
extends ResourceConfig

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 class com.sun.jersey.api.core.ResourceConfig
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
 
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()
           
 java.util.Map<java.lang.String,java.lang.Object>getExplicitRootResources()
          Get a map of explicit root resource classes and root resource singleton instances.
 booleangetFeature(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.ObjectgetProperty(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, 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

DefaultResourceConfig

public DefaultResourceConfig()

DefaultResourceConfig

public DefaultResourceConfig(java.lang.Class<?>... classes)
Parameters:
classes - the initial set of root resource classes and provider classes

DefaultResourceConfig

public DefaultResourceConfig(java.util.Set<java.lang.Class<?>> classes)
Parameters:
classes - the initial set of root resource classes and provider classes
Method Detail

getClasses

public java.util.Set<java.lang.Class<?>> getClasses()
Overrides:
getClasses in class Application

getSingletons

public java.util.Set<java.lang.Object> getSingletons()
Overrides:
getSingletons in class Application

getMediaTypeMappings

public java.util.Map<java.lang.String,MediaType> getMediaTypeMappings()
Description copied from class: ResourceConfig
Get a map of file extension to media type. This is used to drive URI-based content negotiation such that, e.g.:
GET /resource.atom

is equivalent to:

GET /resourceAccept: application/atom+xml

The default implementation returns an empty map.

Overrides:
getMediaTypeMappings in class ResourceConfig
Returns:
a map of file extension to media type

getLanguageMappings

public java.util.Map<java.lang.String,java.lang.String> getLanguageMappings()
Description copied from class: ResourceConfig
Get a map of file extension to language. This is used to drive URI-based content negotiation such that, e.g.:
GET /resource.english

is equivalent to:

GET /resourceAccept-Language: en

The default implementation returns an empty map.

Overrides:
getLanguageMappings in class ResourceConfig
Returns:
a map of file extension to language

getExplicitRootResources

public java.util.Map<java.lang.String,java.lang.Object> getExplicitRootResources()
Description copied from class: ResourceConfig
Get a map of explicit root resource classes and root resource singleton instances. The default lifecycle for root resource class instances is per-request.

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()); 

Overrides:
getExplicitRootResources in class ResourceConfig
Returns:
a map of explicit root resource classes and root resource singleton instances.

getFeatures

public java.util.Map<java.lang.String,java.lang.Boolean> getFeatures()
Description copied from class: ResourceConfig
Get the map of features associated with the Web application.

Specified by:
getFeatures in interface FeaturesAndProperties
Specified by:
getFeatures in class ResourceConfig
Returns:
the features. The returned value shall never be null.

getFeature

public boolean getFeature(java.lang.String featureName)
Description copied from class: ResourceConfig
Get the value of a feature.

Specified by:
getFeature in interface FeaturesAndProperties
Specified by:
getFeature in class ResourceConfig
Parameters:
featureName - the feature name.
Returns:
true if the feature is present and set to true, otherwise false if the feature is present and set to false or the feature is not present.

getProperties

public java.util.Map<java.lang.String,java.lang.Object> getProperties()
Description copied from class: ResourceConfig
Get the map of properties associated with the Web application.

Specified by:
getProperties in interface FeaturesAndProperties
Specified by:
getProperties in class ResourceConfig
Returns:
the properties. The returned value shall never be null.

getProperty

public java.lang.Object getProperty(java.lang.String propertyName)
Description copied from class: ResourceConfig
Get the value of a property.

Specified by:
getProperty in interface FeaturesAndProperties
Specified by:
getProperty in class ResourceConfig
Parameters:
propertyName - the property name.
Returns:
the property, or null if there is no property present for the given property name.


Copyright © 2011
Oracle Corporation. All Rights Reserved.


NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14