org.codehaus.groovy.grails.web.converters.configuration
Class ImmutableConverterConfiguration<C extends Converter>

java.lang.Object
  extended by org.codehaus.groovy.grails.web.converters.configuration.ImmutableConverterConfiguration<C>
All Implemented Interfaces:
ConverterConfiguration<C>

public class ImmutableConverterConfiguration<C extends Converter>
extends Object
implements ConverterConfiguration<C>

Immutable Converter Configuration

Author:
Siegfried Puchbauer
See Also:
ChainedConverterConfiguration

Field Summary
protected  List<ObjectMarshaller<C>> marshallers
           
 
Constructor Summary
ImmutableConverterConfiguration(ConverterConfiguration<C> cfg)
           
ImmutableConverterConfiguration(ConverterConfiguration<C> cfg, ProxyHandler proxyHandler)
           
 
Method Summary
 Converter.CircularReferenceBehaviour getCircularReferenceBehaviour()
          Lookup the configured CircularReferenceBehaviour (how the converter should behave when a circular reference is detected)
 String getEncoding()
          Lookup the configured default Character encoding for the Converter
 ObjectMarshaller<C> getMarshaller(Object o)
          Lookup the ObjectMarshaller with the highest priority that support to marshall the given object
 List<ObjectMarshaller<C>> getOrderedObjectMarshallers()
          Retrieve the ordered list of ObjectMarshallers
 ProxyHandler getProxyHandler()
          Lookup the ProxyHandler used to deal with proxies instances
 boolean isPrettyPrint()
          Lookup method whether the converter should default to pretty printed output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

marshallers

protected final List<ObjectMarshaller<C extends Converter>> marshallers
Constructor Detail

ImmutableConverterConfiguration

public ImmutableConverterConfiguration(ConverterConfiguration<C> cfg)

ImmutableConverterConfiguration

public ImmutableConverterConfiguration(ConverterConfiguration<C> cfg,
                                       ProxyHandler proxyHandler)
Method Detail

getMarshaller

public ObjectMarshaller<C> getMarshaller(Object o)
Description copied from interface: ConverterConfiguration
Lookup the ObjectMarshaller with the highest priority that support to marshall the given object

Specified by:
getMarshaller in interface ConverterConfiguration<C extends Converter>
Parameters:
o - the object which is about to be converted
Returns:
the ObjectMarshaller instance
See Also:
ConverterConfiguration.getMarshaller(Object)

getEncoding

public String getEncoding()
Description copied from interface: ConverterConfiguration
Lookup the configured default Character encoding for the Converter

Specified by:
getEncoding in interface ConverterConfiguration<C extends Converter>
Returns:
the Charset name
See Also:
ConverterConfiguration.getEncoding()

getCircularReferenceBehaviour

public Converter.CircularReferenceBehaviour getCircularReferenceBehaviour()
Description copied from interface: ConverterConfiguration
Lookup the configured CircularReferenceBehaviour (how the converter should behave when a circular reference is detected)

Specified by:
getCircularReferenceBehaviour in interface ConverterConfiguration<C extends Converter>
Returns:
an instance of CircularReferenceBehaviour
See Also:
ConverterConfiguration.getCircularReferenceBehaviour()

isPrettyPrint

public boolean isPrettyPrint()
Description copied from interface: ConverterConfiguration
Lookup method whether the converter should default to pretty printed output

Specified by:
isPrettyPrint in interface ConverterConfiguration<C extends Converter>
Returns:
a boolean
See Also:
ConverterConfiguration.isPrettyPrint()

getOrderedObjectMarshallers

public List<ObjectMarshaller<C>> getOrderedObjectMarshallers()
Description copied from interface: ConverterConfiguration
Retrieve the ordered list of ObjectMarshallers

Specified by:
getOrderedObjectMarshallers in interface ConverterConfiguration<C extends Converter>
Returns:
the List of ObjectMarshallers ordered by priority

getProxyHandler

public ProxyHandler getProxyHandler()
Description copied from interface: ConverterConfiguration
Lookup the ProxyHandler used to deal with proxies instances

Specified by:
getProxyHandler in interface ConverterConfiguration<C extends Converter>
Returns:
The proxy handler


Copyright (c) 2005-2009 The Grails project