Package org.glassfish.jersey.moxy.json
Class MoxyJsonConfig
java.lang.Object
org.glassfish.jersey.moxy.json.MoxyJsonConfig
Configuration class for MOXy JSON provider.
- Author:
- Michal Gajdos
-
Constructor Summary
ConstructorDescriptionCreate a new configuration forMOXyJsonProvider
and initialize default properties.MoxyJsonConfig
(boolean initDefaultProperties) Create a new configuration forMOXyJsonProvider
. -
Method Summary
Modifier and TypeMethodDescriptionGet marshaller properties.char
Get unmarshaller properties.boolean
boolean
boolean
marshallerProperty
(String name, Object value) Set the value of the property for usedMarshaller
.Set the value of the property for bothMarshaller
/Unmarshaller
.resolver()
Create acontext resolver
for a current state of thisMoxyJsonConfig
.setAttributePrefix
(String attributePrefix) setFormattedOutput
(boolean formattedOutput) setIncludeRoot
(boolean includeRoot) setMarshalEmptyCollections
(boolean marshalEmptyCollections) setMarshallerProperties
(Map<String, Object> marshallerProperties) Add properties from the given map to the existing marshaller properties.setNamespacePrefixMapper
(Map<String, String> namespacePrefixMapper) setNamespaceSeparator
(char namespaceSeparator) setUnmarshallerProperties
(Map<String, Object> unmarshallerProperties) Add properties from the given map to the existing unmarshaller properties.setValueWrapper
(String valueWrapper) unmarshallerProperty
(String name, Object value) Set the value of the property for usedUnmarshaller
.
-
Constructor Details
-
MoxyJsonConfig
public MoxyJsonConfig()Create a new configuration forMOXyJsonProvider
and initialize default properties.- See Also:
-
MoxyJsonConfig
public MoxyJsonConfig(boolean initDefaultProperties) Create a new configuration forMOXyJsonProvider
. If theinitDefaultProperties
is set totrue
then the following values are set:Marshaller.JAXB_FORMATTED_OUTPUT
-false
JAXBContextProperties.JSON_INCLUDE_ROOT
-false
MarshallerProperties.JSON_MARSHAL_EMPTY_COLLECTIONS
-true
JAXBContextProperties.JSON_NAMESPACE_SEPARATOR
-Constants.DOT
- Parameters:
initDefaultProperties
- flag to determine whether the default values of properties mentioned above should be set or not.
-
-
Method Details
-
property
Set the value of the property for bothMarshaller
/Unmarshaller
.- Parameters:
name
- name of the property.value
- value of the property.- Returns:
- a
MoxyJsonConfig
instance.
-
marshallerProperty
Set the value of the property for usedMarshaller
.- Parameters:
name
- name of the property.value
- value of the property.- Returns:
- a
MoxyJsonConfig
instance.
-
unmarshallerProperty
Set the value of the property for usedUnmarshaller
.- Parameters:
name
- name of the property.value
- value of the property.- Returns:
- a
MoxyJsonConfig
instance.
-
setMarshallerProperties
Add properties from the given map to the existing marshaller properties.- Parameters:
marshallerProperties
- map of marshaller properties.- Returns:
- a
MoxyJsonConfig
instance.
-
setUnmarshallerProperties
Add properties from the given map to the existing unmarshaller properties.- Parameters:
unmarshallerProperties
- map of unmarshaller properties.- Returns:
- a
MoxyJsonConfig
instance.
-
getMarshallerProperties
Get marshaller properties.- Returns:
- mutable map of marshaller properties.
-
getUnmarshallerProperties
Get unmarshaller properties.- Returns:
- mutable map of unmarshaller properties.
-
getAttributePrefix
- See Also:
-
MOXyJsonProvider.getAttributePrefix()
-
setAttributePrefix
- See Also:
-
MOXyJsonProvider.setAttributePrefix(String)
-
isFormattedOutput
public boolean isFormattedOutput()- See Also:
-
MOXyJsonProvider.isFormattedOutput()
-
setFormattedOutput
- See Also:
-
MOXyJsonProvider.setFormattedOutput(boolean)
-
isIncludeRoot
public boolean isIncludeRoot()- See Also:
-
MOXyJsonProvider.isIncludeRoot()
-
setIncludeRoot
- See Also:
-
MOXyJsonProvider.setIncludeRoot(boolean)
-
isMarshalEmptyCollections
public boolean isMarshalEmptyCollections()- See Also:
-
MOXyJsonProvider.isMarshalEmptyCollections()
-
setMarshalEmptyCollections
- See Also:
-
MOXyJsonProvider.setMarshalEmptyCollections(boolean)
-
getNamespacePrefixMapper
- See Also:
-
MOXyJsonProvider.getNamespacePrefixMapper()
-
setNamespacePrefixMapper
- See Also:
-
MOXyJsonProvider.setNamespacePrefixMapper(java.util.Map)
-
getNamespaceSeparator
public char getNamespaceSeparator()- See Also:
-
MOXyJsonProvider.getNamespaceSeparator()
-
setNamespaceSeparator
- See Also:
-
MOXyJsonProvider.setNamespaceSeparator(char)
-
getValueWrapper
- See Also:
-
MOXyJsonProvider.getValueWrapper()
-
setValueWrapper
- See Also:
-
MOXyJsonProvider.setValueWrapper(String)
-
resolver
Create acontext resolver
for a current state of thisMoxyJsonConfig
.- Returns:
- context resolver for this config.
-