com.sun.jersey.api.core
Class DefaultResourceConfig

java.lang.Object
  extended by javax.ws.rs.core.ApplicationConfig
      extended by com.sun.jersey.api.core.ResourceConfig
          extended by com.sun.jersey.api.core.DefaultResourceConfig
Direct Known Subclasses:
ApplicationConfigAdapter, ClasspathResourceConfig, PackagesResourceConfig

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
FEATURE_CANONICALIZE_URI_PATH, FEATURE_IMPLICIT_VIEWABLES, FEATURE_MATCH_MATRIX_PARAMS, FEATURE_NORMALIZE_URI, FEATURE_REDIRECT, PROPERTY_CONTAINER_NOTIFIER, PROPERTY_DEFAULT_RESOURCE_PROVIDER_CLASS
 
Constructor Summary
DefaultResourceConfig()
           
DefaultResourceConfig(java.lang.Class<?>... resources)
           
DefaultResourceConfig(java.util.Set<java.lang.Class<?>> resources)
           
 
Method Summary
 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()
           
 java.util.Map<java.lang.String,javax.ws.rs.core.MediaType> getMediaTypeMappings()
           
 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.Class<?>> getProviderClasses()
           
 java.util.Set<java.lang.Object> getProviderInstances()
          Get the provider instances to be utilized by the web application.
 java.util.Set<java.lang.Class<?>> getResourceClasses()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultResourceConfig

public DefaultResourceConfig()

DefaultResourceConfig

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

DefaultResourceConfig

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

getResourceClasses

public java.util.Set<java.lang.Class<?>> getResourceClasses()
Specified by:
getResourceClasses in class javax.ws.rs.core.ApplicationConfig

getProviderClasses

public java.util.Set<java.lang.Class<?>> getProviderClasses()
Overrides:
getProviderClasses in class javax.ws.rs.core.ApplicationConfig

getMediaTypeMappings

public java.util.Map<java.lang.String,javax.ws.rs.core.MediaType> getMediaTypeMappings()
Overrides:
getMediaTypeMappings in class javax.ws.rs.core.ApplicationConfig

getLanguageMappings

public java.util.Map<java.lang.String,java.lang.String> getLanguageMappings()
Overrides:
getLanguageMappings in class javax.ws.rs.core.ApplicationConfig

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 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 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 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 class ResourceConfig
Parameters:
propertyName - the property name.
Returns:
the property, or null if there is no property present for the given property name.

getProviderInstances

public java.util.Set<java.lang.Object> getProviderInstances()
Description copied from class: ResourceConfig
Get the provider instances to be utilized by the web application.

When the web application is initialized the set of provider instances will be combined and take precendence over the instances of provider classes declared by ApplicationConfig.

Specified by:
getProviderInstances in class ResourceConfig
Returns:
a mutable set of provider instances. After intialization of the Web application modification of this value will have no effect.