org.codehaus.groovy.grails.web.converters.marshaller.json
Class DateMarshaller

java.lang.Object
  extended by org.codehaus.groovy.grails.web.converters.marshaller.json.DateMarshaller
All Implemented Interfaces:
ObjectMarshaller<JSON>

public class DateMarshaller
extends java.lang.Object
implements ObjectMarshaller<JSON>

JSON ObjectMarshaller which converts a Date Object, conforming to the ECMA-Script-Specification Draft, to a String value.

Since:
1.1

Constructor Summary
DateMarshaller()
          Default constructor.
DateMarshaller(java.text.Format formatter)
          Constructor with a custom formatter.
 
Method Summary
 void marshalObject(java.lang.Object object, JSON converter)
          Performs the conversion
 boolean supports(java.lang.Object object)
          Checks wheter the ObjectMarshaller is able/intended to support the given Object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateMarshaller

public DateMarshaller(java.text.Format formatter)
Constructor with a custom formatter.

Parameters:
formatter - the formatter

DateMarshaller

public DateMarshaller()
Default constructor.

Method Detail

supports

public boolean supports(java.lang.Object object)
Description copied from interface: ObjectMarshaller
Checks wheter the ObjectMarshaller is able/intended to support the given Object

Specified by:
supports in interface ObjectMarshaller<JSON>
Parameters:
object - the object which is about getting converted
Returns:
true if the marshaller can/should perform the marshalling, false otherwise

marshalObject

public void marshalObject(java.lang.Object object,
                          JSON converter)
                   throws ConverterException
Description copied from interface: ObjectMarshaller
Performs the conversion

Specified by:
marshalObject in interface ObjectMarshaller<JSON>
Parameters:
object - the object which is about getting converted
converter - the Converter to use
Throws:
ConverterException - on failure