|
||||||||||
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 |
---|
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 ';'. |
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()
|
protected void |
setPropertiesAndFeatures(java.util.Map<java.lang.String,java.lang.Object> entries)
Set the properties and features given a map of entries. |
Methods inherited from class com.sun.jersey.api.core.ResourceConfig |
---|
getProviderClasses, getProviderSingletons, getRootResourceClasses, getRootResourceSingletons, validate |
Methods inherited from class java.lang.Object |
---|
clone, 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.Boolean> getFeatures()
ResourceConfig
getFeatures
in class ResourceConfig
public boolean getFeature(java.lang.String featureName)
ResourceConfig
getFeature
in class ResourceConfig
featureName
- the feature name.
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
ResourceConfig
getProperties
in class ResourceConfig
public java.lang.Object getProperty(java.lang.String propertyName)
ResourceConfig
getProperty
in class ResourceConfig
propertyName
- the property name.
protected void setPropertiesAndFeatures(java.util.Map<java.lang.String,java.lang.Object> entries)
entries
- the map of entries. All entries are added as properties.
Any entry with a value that is an
instance of Boolean is added as a feature with the feature name set
to the entry name and the feature value set to the entry value.
Any entry with a value that is an instance String and is equal (ignoring
case) to "true" or "false" is added as a feature with the feature name
set to the entry name and the feature value set to the Boolean value
of the entry value. Features are only added if an existing feature
does not currently exist.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 |