Class CommonProperties
- java.lang.Object
-
- org.glassfish.jersey.CommonProperties
-
public final class CommonProperties extends java.lang.Object
Common (server/client) Jersey configuration properties.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FEATURE_AUTO_DISCOVERY_DISABLE
Iftrue
then disable feature auto discovery globally on client/server.static java.lang.String
FEATURE_AUTO_DISCOVERY_DISABLE_CLIENT
Client-specific version ofFEATURE_AUTO_DISCOVERY_DISABLE
.static java.lang.String
FEATURE_AUTO_DISCOVERY_DISABLE_SERVER
Server-specific version ofFEATURE_AUTO_DISCOVERY_DISABLE
.static java.lang.String
JSON_PROCESSING_FEATURE_DISABLE
Iftrue
then disable configuration of Json Processing (JSR-353) feature.static java.lang.String
JSON_PROCESSING_FEATURE_DISABLE_CLIENT
Client-specific version ofJSON_PROCESSING_FEATURE_DISABLE
.static java.lang.String
JSON_PROCESSING_FEATURE_DISABLE_SERVER
Server-specific version ofJSON_PROCESSING_FEATURE_DISABLE
.private static java.util.Map<java.lang.String,java.lang.String>
LEGACY_FALLBACK_MAP
static java.lang.String
METAINF_SERVICES_LOOKUP_DISABLE
Iftrue
then disable META-INF/services lookup globally on client/server.static java.lang.String
METAINF_SERVICES_LOOKUP_DISABLE_CLIENT
Client-specific version ofMETAINF_SERVICES_LOOKUP_DISABLE
.static java.lang.String
METAINF_SERVICES_LOOKUP_DISABLE_SERVER
Server-specific version ofMETAINF_SERVICES_LOOKUP_DISABLE
.static java.lang.String
MOXY_JSON_FEATURE_DISABLE
Iftrue
then disable configuration of MOXy Json feature.static java.lang.String
MOXY_JSON_FEATURE_DISABLE_CLIENT
Client-specific version ofMOXY_JSON_FEATURE_DISABLE
.static java.lang.String
MOXY_JSON_FEATURE_DISABLE_SERVER
Server-specific version ofMOXY_JSON_FEATURE_DISABLE
.static java.lang.String
OUTBOUND_CONTENT_LENGTH_BUFFER
An integer value that defines the buffer size used to buffer the outbound message entity in order to determine its size and set the value of HTTP "Content-Length" header.static java.lang.String
OUTBOUND_CONTENT_LENGTH_BUFFER_CLIENT
Client-specific version ofOUTBOUND_CONTENT_LENGTH_BUFFER
.static java.lang.String
OUTBOUND_CONTENT_LENGTH_BUFFER_SERVER
Server-specific version ofOUTBOUND_CONTENT_LENGTH_BUFFER
.
-
Constructor Summary
Constructors Modifier Constructor Description private
CommonProperties()
Prevent instantiation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Object
getValue(java.util.Map<java.lang.String,?> properties, java.lang.String propertyName, java.lang.Class<?> type)
Get the value of the specified property.static <T> T
getValue(java.util.Map<java.lang.String,?> properties, java.lang.String propertyName, T defaultValue)
Get the value of the specified property.static <T> T
getValue(java.util.Map<java.lang.String,?> properties, javax.ws.rs.RuntimeType runtime, java.lang.String propertyName, java.lang.Class<T> type)
Get the value of the specified property.static <T> T
getValue(java.util.Map<java.lang.String,?> properties, javax.ws.rs.RuntimeType runtime, java.lang.String propertyName, T defaultValue)
Get the value of the specified property.static <T> T
getValue(java.util.Map<java.lang.String,?> properties, javax.ws.rs.RuntimeType runtime, java.lang.String propertyName, T defaultValue, java.lang.Class<T> type)
Get the value of the specified property.
-
-
-
Field Detail
-
LEGACY_FALLBACK_MAP
private static final java.util.Map<java.lang.String,java.lang.String> LEGACY_FALLBACK_MAP
-
FEATURE_AUTO_DISCOVERY_DISABLE
public static final java.lang.String FEATURE_AUTO_DISCOVERY_DISABLE
Iftrue
then disable feature auto discovery globally on client/server.By default auto discovery is automatically enabled. The value of this property may be overridden by the client/server variant of this property.
The default value is
false
.The name of the configuration property is "jersey.config.disableAutoDiscovery".
- See Also:
- Constant Field Values
-
FEATURE_AUTO_DISCOVERY_DISABLE_CLIENT
public static final java.lang.String FEATURE_AUTO_DISCOVERY_DISABLE_CLIENT
Client-specific version ofFEATURE_AUTO_DISCOVERY_DISABLE
. If present, it overrides the generic one for the client environment.- Since:
- 2.8
- See Also:
- Constant Field Values
-
FEATURE_AUTO_DISCOVERY_DISABLE_SERVER
public static final java.lang.String FEATURE_AUTO_DISCOVERY_DISABLE_SERVER
Server-specific version ofFEATURE_AUTO_DISCOVERY_DISABLE
. If present, it overrides the generic one for the server environment.- Since:
- 2.8
- See Also:
- Constant Field Values
-
JSON_PROCESSING_FEATURE_DISABLE
public static final java.lang.String JSON_PROCESSING_FEATURE_DISABLE
Iftrue
then disable configuration of Json Processing (JSR-353) feature.By default Json Processing is automatically enabled. The value of this property may be overridden by the client/server variant of this property.
The default value is
false
.The name of the configuration property is "jersey.config.disableJsonProcessing".
- See Also:
- Constant Field Values
-
JSON_PROCESSING_FEATURE_DISABLE_CLIENT
public static final java.lang.String JSON_PROCESSING_FEATURE_DISABLE_CLIENT
Client-specific version ofJSON_PROCESSING_FEATURE_DISABLE
. If present, it overrides the generic one for the client environment.- Since:
- 2.8
- See Also:
- Constant Field Values
-
JSON_PROCESSING_FEATURE_DISABLE_SERVER
public static final java.lang.String JSON_PROCESSING_FEATURE_DISABLE_SERVER
Server-specific version ofJSON_PROCESSING_FEATURE_DISABLE
. If present, it overrides the generic one for the server environment.- Since:
- 2.8
- See Also:
- Constant Field Values
-
METAINF_SERVICES_LOOKUP_DISABLE
public static final java.lang.String METAINF_SERVICES_LOOKUP_DISABLE
Iftrue
then disable META-INF/services lookup globally on client/server.By default Jersey looks up SPI implementations described by META-INF/services/* files. Then you can register appropriate provider classes by
Application
.The default value is
false
.The name of the configuration property is "jersey.config.disableMetainfServicesLookup".
- Since:
- 2.1
- See Also:
- Constant Field Values
-
METAINF_SERVICES_LOOKUP_DISABLE_CLIENT
public static final java.lang.String METAINF_SERVICES_LOOKUP_DISABLE_CLIENT
Client-specific version ofMETAINF_SERVICES_LOOKUP_DISABLE
. If present, it overrides the generic one for the client environment.- Since:
- 2.8
- See Also:
- Constant Field Values
-
METAINF_SERVICES_LOOKUP_DISABLE_SERVER
public static final java.lang.String METAINF_SERVICES_LOOKUP_DISABLE_SERVER
Server-specific version ofMETAINF_SERVICES_LOOKUP_DISABLE
. If present, it overrides the generic one for the server environment.- Since:
- 2.8
- See Also:
- Constant Field Values
-
MOXY_JSON_FEATURE_DISABLE
public static final java.lang.String MOXY_JSON_FEATURE_DISABLE
Iftrue
then disable configuration of MOXy Json feature.By default MOXy Json is automatically enabled. The value of this property may be overridden by the client/server variant of this property.
The default value is
false
.The name of the configuration property is "jersey.config.disableMoxyJson".
- See Also:
- Constant Field Values
-
MOXY_JSON_FEATURE_DISABLE_CLIENT
public static final java.lang.String MOXY_JSON_FEATURE_DISABLE_CLIENT
Client-specific version ofMOXY_JSON_FEATURE_DISABLE
. If present, it overrides the generic one for the client environment.- Since:
- 2.8
- See Also:
- Constant Field Values
-
MOXY_JSON_FEATURE_DISABLE_SERVER
public static final java.lang.String MOXY_JSON_FEATURE_DISABLE_SERVER
Server-specific version ofMOXY_JSON_FEATURE_DISABLE
. If present, it overrides the generic one for the server environment.- Since:
- 2.8
- See Also:
- Constant Field Values
-
OUTBOUND_CONTENT_LENGTH_BUFFER
public static final java.lang.String OUTBOUND_CONTENT_LENGTH_BUFFER
An integer value that defines the buffer size used to buffer the outbound message entity in order to determine its size and set the value of HTTP "Content-Length" header.If the entity size exceeds the configured buffer size, the buffering would be cancelled and the entity size would not be determined. Value less or equal to zero disable the buffering of the entity at all.
The value of this property may be overridden by the client/server variant of this property by defining the suffix to this property ".server" or ".client" ("jersey.config.contentLength.buffer".server or "jersey.config.contentLength.buffer".client).The default value is 8192.
The name of the configuration property is "jersey.config.contentLength.buffer".
- See Also:
- Constant Field Values
-
OUTBOUND_CONTENT_LENGTH_BUFFER_CLIENT
public static final java.lang.String OUTBOUND_CONTENT_LENGTH_BUFFER_CLIENT
Client-specific version ofOUTBOUND_CONTENT_LENGTH_BUFFER
. If present, it overrides the generic one for the client environment.- Since:
- 2.8
- See Also:
- Constant Field Values
-
OUTBOUND_CONTENT_LENGTH_BUFFER_SERVER
public static final java.lang.String OUTBOUND_CONTENT_LENGTH_BUFFER_SERVER
Server-specific version ofOUTBOUND_CONTENT_LENGTH_BUFFER
. If present, it overrides the generic one for the server environment.- Since:
- 2.8
- See Also:
- Constant Field Values
-
-
Method Detail
-
getValue
public static java.lang.Object getValue(java.util.Map<java.lang.String,?> properties, java.lang.String propertyName, java.lang.Class<?> type)
Get the value of the specified property. If the property is not set or the actual property value type is not compatible with the specified type, the method will returnnull
.- Parameters:
properties
- Map of properties to get the property value from.propertyName
- Name of the property.type
- Type to retrieve the value as.- Returns:
- Value of the property or
null
. - Since:
- 2.8
-
getValue
public static <T> T getValue(java.util.Map<java.lang.String,?> properties, java.lang.String propertyName, T defaultValue)
Get the value of the specified property. If the property is not set or the real value type is not compatible withdefaultValue
type, the specifieddefaultValue
is returned. Calling this method is equivalent to callingCommonProperties.getValue(properties, key, defaultValue, (Class<T>) defaultValue.getClass())
- Type Parameters:
T
- Type of the property value.- Parameters:
properties
- Map of properties to get the property value from.propertyName
- Name of the property.defaultValue
- Default value if property is not registered- Returns:
- Value of the property or
null
. - Since:
- 2.8
-
getValue
public static <T> T getValue(java.util.Map<java.lang.String,?> properties, javax.ws.rs.RuntimeType runtime, java.lang.String propertyName, T defaultValue)
Get the value of the specified property. If the property is not set or the real value type is not compatible withdefaultValue
type, the specifieddefaultValue
is returned. Calling this method is equivalent to callingCommonProperties.getValue(properties, runtimeType, key, defaultValue, (Class<T>) defaultValue.getClass())
- Type Parameters:
T
- Type of the property value.- Parameters:
properties
- Map of properties to get the property value from.runtime
- Runtime type which is used to check whether there is a property with the samekey
but post-fixed by runtime type (.server or.client
) which would override thekey
property.propertyName
- Name of the property.defaultValue
- Default value if property is not registered- Returns:
- Value of the property or
null
. - Since:
- 2.8
-
getValue
public static <T> T getValue(java.util.Map<java.lang.String,?> properties, javax.ws.rs.RuntimeType runtime, java.lang.String propertyName, T defaultValue, java.lang.Class<T> type)
Get the value of the specified property. If the property is not set or the real value type is not compatible with the specified value type, returnsdefaultValue
.- Type Parameters:
T
- Type of the property value.- Parameters:
properties
- Map of properties to get the property value from.runtime
- Runtime type which is used to check whether there is a property with the samekey
but post-fixed by runtime type (.server or.client
) which would override thekey
property.propertyName
- Name of the property.defaultValue
- Default value if property is not registeredtype
- Type to retrieve the value as.- Returns:
- Value of the property or
null
. - Since:
- 2.8
-
getValue
public static <T> T getValue(java.util.Map<java.lang.String,?> properties, javax.ws.rs.RuntimeType runtime, java.lang.String propertyName, java.lang.Class<T> type)
Get the value of the specified property. If the property is not set or the actual property value type is not compatible with the specified type, the method will returnnull
.- Type Parameters:
T
- Type of the property value.- Parameters:
properties
- Map of properties to get the property value from.runtime
- Runtime type which is used to check whether there is a property with the samekey
but post-fixed by runtime type (.server or.client
) which would override thekey
property.propertyName
- Name of the property.type
- Type to retrieve the value as.- Returns:
- Value of the property or
null
. - Since:
- 2.8
-
-