ca.quine.jcommons.sourceexporter
Class ImmutableMarshaller

java.lang.Object
  |
  +--ca.quine.jcommons.sourceexporter.SourceMarshaller
        |
        +--ca.quine.jcommons.sourceexporter.ImmutableMarshaller
Direct Known Subclasses:
CustomMarshallerExample

public abstract class ImmutableMarshaller
extends SourceMarshaller

This class is a base class for custom marshallers that marshal an immutable class (with no public setter methods and no public no-args constructor). To write your own such marshaller, see the source code for CustomMarshallerExample.


Constructor Summary
ImmutableMarshaller()
           
 
Method Summary
abstract  boolean doesMarshal(Object object)
           
 String marshal(ChainOfResponsibility chainOfResponsibility, MarshallingContext context, ClassSource classSource, Object object, boolean marshalAsObject)
           
protected abstract  String marshalConstructorParams(ChainOfResponsibility chainOfResponsibility, MarshallingContext context, ClassSource classSource, Object object)
           
 
Methods inherited from class ca.quine.jcommons.sourceexporter.SourceMarshaller
createMethodSource, marshal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImmutableMarshaller

public ImmutableMarshaller()
Method Detail

doesMarshal

public abstract boolean doesMarshal(Object object)
Specified by:
doesMarshal in class SourceMarshaller

marshal

public String marshal(ChainOfResponsibility chainOfResponsibility,
                      MarshallingContext context,
                      ClassSource classSource,
                      Object object,
                      boolean marshalAsObject)
               throws IOException,
                      IllegalArgumentException,
                      IllegalAccessException,
                      InvocationTargetException,
                      InstantiationException,
                      ClassNotFoundException
Specified by:
marshal in class SourceMarshaller
IOException
IllegalArgumentException
IllegalAccessException
InvocationTargetException
InstantiationException
ClassNotFoundException

marshalConstructorParams

protected abstract String marshalConstructorParams(ChainOfResponsibility chainOfResponsibility,
                                                   MarshallingContext context,
                                                   ClassSource classSource,
                                                   Object object)
                                            throws IOException,
                                                   IllegalAccessException,
                                                   InvocationTargetException,
                                                   ClassNotFoundException,
                                                   InstantiationException
IOException
IllegalAccessException
InvocationTargetException
ClassNotFoundException
InstantiationException