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
ConstructorsConstructorDescriptionCreate a new configuration forMOXyJsonProviderand initialize default properties.MoxyJsonConfig(boolean initDefaultProperties) Create a new configuration forMOXyJsonProvider. -
Method Summary
Modifier and TypeMethodDescriptionGet marshaller properties.charGet unmarshaller properties.booleanbooleanbooleanmarshallerProperty(String name, Object value) Set the value of the property for usedMarshaller.Set the value of the property for bothMarshaller/Unmarshaller.resolver()Create acontext resolverfor 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 forMOXyJsonProviderand initialize default properties.- See Also:
-
MoxyJsonConfig
public MoxyJsonConfig(boolean initDefaultProperties) Create a new configuration forMOXyJsonProvider. If theinitDefaultPropertiesis set totruethen the following values are set:Marshaller.JAXB_FORMATTED_OUTPUT-falseJAXBContextProperties.JSON_INCLUDE_ROOT-falseMarshallerProperties.JSON_MARSHAL_EMPTY_COLLECTIONS-trueJAXBContextProperties.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
MoxyJsonConfiginstance.
-
marshallerProperty
Set the value of the property for usedMarshaller.- Parameters:
name- name of the property.value- value of the property.- Returns:
- a
MoxyJsonConfiginstance.
-
unmarshallerProperty
Set the value of the property for usedUnmarshaller.- Parameters:
name- name of the property.value- value of the property.- Returns:
- a
MoxyJsonConfiginstance.
-
setMarshallerProperties
Add properties from the given map to the existing marshaller properties.- Parameters:
marshallerProperties- map of marshaller properties.- Returns:
- a
MoxyJsonConfiginstance.
-
setUnmarshallerProperties
Add properties from the given map to the existing unmarshaller properties.- Parameters:
unmarshallerProperties- map of unmarshaller properties.- Returns:
- a
MoxyJsonConfiginstance.
-
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 resolverfor a current state of thisMoxyJsonConfig.- Returns:
- context resolver for this config.
-