org.glassfish.jersey.moxy.json
Class MoxyJsonConfig

java.lang.Object
  extended by org.glassfish.jersey.moxy.json.MoxyJsonConfig

public final class MoxyJsonConfig
extends Object

Configuration class for MOXy JSON provider.

Author:
Michal Gajdos (michal.gajdos at oracle.com)

Constructor Summary
MoxyJsonConfig()
          Create a new configuration for MOXyJsonProvider and initialize default properties.
MoxyJsonConfig(boolean initDefaultProperties)
          Create a new configuration for MOXyJsonProvider.
 
Method Summary
 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.
 javax.ws.rs.ext.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoxyJsonConfig

public MoxyJsonConfig()
Create a new configuration for MOXyJsonProvider and initialize default properties.

See Also:
MoxyJsonConfig(boolean)

MoxyJsonConfig

public MoxyJsonConfig(boolean initDefaultProperties)
Create a new configuration for MOXyJsonProvider. If the initDefaultProperties is set to true then the following values are set:

Parameters:
initDefaultProperties - flag to determine whether the default values of properties mentioned above should be set or not.
Method Detail

property

public MoxyJsonConfig property(String name,
                               Object value)
Set the value of the property for both Marshaller / Unmarshaller.

Parameters:
name - name of the property.
value - value of the property.
Returns:
a MoxyJsonConfig instance.

marshallerProperty

public MoxyJsonConfig marshallerProperty(String name,
                                         Object value)
Set the value of the property for used Marshaller.

Parameters:
name - name of the property.
value - value of the property.
Returns:
a MoxyJsonConfig instance.

unmarshallerProperty

public MoxyJsonConfig unmarshallerProperty(String name,
                                           Object value)
Set the value of the property for used Unmarshaller.

Parameters:
name - name of the property.
value - value of the property.
Returns:
a MoxyJsonConfig instance.

setMarshallerProperties

public MoxyJsonConfig setMarshallerProperties(Map<String,Object> marshallerProperties)
Add properties from the given map to the existing marshaller properties.

Parameters:
marshallerProperties - map of marshaller properties.
Returns:
a MoxyJsonConfig instance.

setUnmarshallerProperties

public MoxyJsonConfig setUnmarshallerProperties(Map<String,Object> unmarshallerProperties)
Add properties from the given map to the existing unmarshaller properties.

Parameters:
unmarshallerProperties - map of unmarshaller properties.
Returns:
a MoxyJsonConfig instance.

getMarshallerProperties

public Map<String,Object> getMarshallerProperties()
Get marshaller properties.

Returns:
mutable map of marshaller properties.

getUnmarshallerProperties

public Map<String,Object> getUnmarshallerProperties()
Get unmarshaller properties.

Returns:
mutable map of unmarshaller properties.

getAttributePrefix

public String getAttributePrefix()
See Also:
MOXyJsonProvider.getAttributePrefix()

setAttributePrefix

public MoxyJsonConfig setAttributePrefix(String attributePrefix)
See Also:
MOXyJsonProvider.setAttributePrefix(String)

isFormattedOutput

public boolean isFormattedOutput()
See Also:
MOXyJsonProvider.isFormattedOutput()

setFormattedOutput

public MoxyJsonConfig setFormattedOutput(boolean formattedOutput)
See Also:
MOXyJsonProvider.setFormattedOutput(boolean)

isIncludeRoot

public boolean isIncludeRoot()
See Also:
MOXyJsonProvider.isIncludeRoot()

setIncludeRoot

public MoxyJsonConfig setIncludeRoot(boolean includeRoot)
See Also:
MOXyJsonProvider.setIncludeRoot(boolean)

isMarshalEmptyCollections

public boolean isMarshalEmptyCollections()
See Also:
MOXyJsonProvider.isMarshalEmptyCollections()

setMarshalEmptyCollections

public MoxyJsonConfig setMarshalEmptyCollections(boolean marshalEmptyCollections)
See Also:
MOXyJsonProvider.setMarshalEmptyCollections(boolean)

getNamespacePrefixMapper

public Map<String,String> getNamespacePrefixMapper()
See Also:
MOXyJsonProvider.getNamespacePrefixMapper()

setNamespacePrefixMapper

public MoxyJsonConfig setNamespacePrefixMapper(Map<String,String> namespacePrefixMapper)
See Also:
MOXyJsonProvider.setNamespacePrefixMapper(java.util.Map)

getNamespaceSeparator

public char getNamespaceSeparator()
See Also:
MOXyJsonProvider.getNamespaceSeparator()

setNamespaceSeparator

public MoxyJsonConfig setNamespaceSeparator(char namespaceSeparator)
See Also:
MOXyJsonProvider.setNamespaceSeparator(char)

getValueWrapper

public String getValueWrapper()
See Also:
MOXyJsonProvider.getValueWrapper()

setValueWrapper

public MoxyJsonConfig setValueWrapper(String valueWrapper)
See Also:
MOXyJsonProvider.setValueWrapper(String)

resolver

public javax.ws.rs.ext.ContextResolver<MoxyJsonConfig> resolver()
Create a context resolver for a current state of this MoxyJsonConfig.

Returns:
context resolver for this config.


Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.