public final class MoxyJsonConfig extends Object
Constructor and Description |
---|
MoxyJsonConfig()
Create a new configuration for
MOXyJsonProvider and initialize default properties. |
MoxyJsonConfig(boolean initDefaultProperties)
Create a new configuration for
MOXyJsonProvider . |
Modifier and Type | Method and Description |
---|---|
String |
getAttributePrefix() |
Map<String,Object> |
getMarshallerProperties()
Get marshaller properties.
|
Map<String,String> |
getNamespacePrefixMapper() |
char |
getNamespaceSeparator() |
Map<String,Object> |
getUnmarshallerProperties()
Get unmarshaller properties.
|
String |
getValueWrapper() |
boolean |
isFormattedOutput() |
boolean |
isIncludeRoot() |
boolean |
isMarshalEmptyCollections() |
MoxyJsonConfig |
marshallerProperty(String name,
Object value)
Set the value of the property for used
Marshaller . |
MoxyJsonConfig |
property(String name,
Object value)
Set the value of the property for both
Marshaller / Unmarshaller . |
ContextResolver<MoxyJsonConfig> |
resolver()
Create a
context resolver for a current state of this MoxyJsonConfig . |
MoxyJsonConfig |
setAttributePrefix(String attributePrefix) |
MoxyJsonConfig |
setFormattedOutput(boolean formattedOutput) |
MoxyJsonConfig |
setIncludeRoot(boolean includeRoot) |
MoxyJsonConfig |
setMarshalEmptyCollections(boolean marshalEmptyCollections) |
MoxyJsonConfig |
setMarshallerProperties(Map<String,Object> marshallerProperties)
Add properties from the given map to the existing marshaller properties.
|
MoxyJsonConfig |
setNamespacePrefixMapper(Map<String,String> namespacePrefixMapper) |
MoxyJsonConfig |
setNamespaceSeparator(char namespaceSeparator) |
MoxyJsonConfig |
setUnmarshallerProperties(Map<String,Object> unmarshallerProperties)
Add properties from the given map to the existing unmarshaller properties.
|
MoxyJsonConfig |
setValueWrapper(String valueWrapper) |
MoxyJsonConfig |
unmarshallerProperty(String name,
Object value)
Set the value of the property for used
Unmarshaller . |
public MoxyJsonConfig()
MOXyJsonProvider
and initialize default properties.MoxyJsonConfig(boolean)
public MoxyJsonConfig(boolean initDefaultProperties)
MOXyJsonProvider
. If the
initDefaultProperties
is set to true
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
initDefaultProperties
- flag to determine whether the default values of properties mentioned above should be set or
not.public MoxyJsonConfig property(String name, Object value)
Marshaller
/ Unmarshaller
.name
- name of the property.value
- value of the property.MoxyJsonConfig
instance.public MoxyJsonConfig marshallerProperty(String name, Object value)
Marshaller
.name
- name of the property.value
- value of the property.MoxyJsonConfig
instance.public MoxyJsonConfig unmarshallerProperty(String name, Object value)
Unmarshaller
.name
- name of the property.value
- value of the property.MoxyJsonConfig
instance.public MoxyJsonConfig setMarshallerProperties(Map<String,Object> marshallerProperties)
marshallerProperties
- map of marshaller properties.MoxyJsonConfig
instance.public MoxyJsonConfig setUnmarshallerProperties(Map<String,Object> unmarshallerProperties)
unmarshallerProperties
- map of unmarshaller properties.MoxyJsonConfig
instance.public Map<String,Object> getMarshallerProperties()
public Map<String,Object> getUnmarshallerProperties()
public String getAttributePrefix()
MOXyJsonProvider.getAttributePrefix()
public MoxyJsonConfig setAttributePrefix(String attributePrefix)
MOXyJsonProvider.setAttributePrefix(String)
public boolean isFormattedOutput()
MOXyJsonProvider.isFormattedOutput()
public MoxyJsonConfig setFormattedOutput(boolean formattedOutput)
MOXyJsonProvider.setFormattedOutput(boolean)
public boolean isIncludeRoot()
MOXyJsonProvider.isIncludeRoot()
public MoxyJsonConfig setIncludeRoot(boolean includeRoot)
MOXyJsonProvider.setIncludeRoot(boolean)
public boolean isMarshalEmptyCollections()
MOXyJsonProvider.isMarshalEmptyCollections()
public MoxyJsonConfig setMarshalEmptyCollections(boolean marshalEmptyCollections)
MOXyJsonProvider.setMarshalEmptyCollections(boolean)
public Map<String,String> getNamespacePrefixMapper()
MOXyJsonProvider.getNamespacePrefixMapper()
public MoxyJsonConfig setNamespacePrefixMapper(Map<String,String> namespacePrefixMapper)
MOXyJsonProvider.setNamespacePrefixMapper(java.util.Map)
public char getNamespaceSeparator()
MOXyJsonProvider.getNamespaceSeparator()
public MoxyJsonConfig setNamespaceSeparator(char namespaceSeparator)
MOXyJsonProvider.setNamespaceSeparator(char)
public String getValueWrapper()
MOXyJsonProvider.getValueWrapper()
public MoxyJsonConfig setValueWrapper(String valueWrapper)
MOXyJsonProvider.setValueWrapper(String)
public ContextResolver<MoxyJsonConfig> resolver()
context resolver
for a current state of this MoxyJsonConfig
.Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.