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
-
getUnmarshallerProperties
-
getAttributePrefix
- See Also:
-
setAttributePrefix
- See Also:
-
isFormattedOutput
public boolean isFormattedOutput()- See Also:
-
setFormattedOutput
- See Also:
-
isIncludeRoot
public boolean isIncludeRoot()- See Also:
-
setIncludeRoot
- See Also:
-
isMarshalEmptyCollections
public boolean isMarshalEmptyCollections()- See Also:
-
setMarshalEmptyCollections
- See Also:
-
getNamespacePrefixMapper
-
setNamespacePrefixMapper
- See Also:
-
getNamespaceSeparator
public char getNamespaceSeparator()- See Also:
-
setNamespaceSeparator
- See Also:
-
getValueWrapper
- See Also:
-
setValueWrapper
- See Also:
-
resolver
Create acontext resolverfor a current state of thisMoxyJsonConfig.- Returns:
- context resolver for this config.
-