ca.quine.jcommons.sourceexporter
Class CollectionMarshaller

java.lang.Object
  |
  +--ca.quine.jcommons.sourceexporter.SourceMarshaller
        |
        +--ca.quine.jcommons.sourceexporter.CollectionMarshaller
Direct Known Subclasses:
ArrayMarshaller, ListMarshaller, MapMarshaller, SetMarshaller

public abstract class CollectionMarshaller
extends SourceMarshaller

The superclass of all marshallers that marshal a Collection (or array) of Objects. To write your own collection marshaller, see the source code for ListMarshaller.


Constructor Summary
CollectionMarshaller()
           
 
Method Summary
protected abstract  void addItemsToReturnValue(ChainOfResponsibility chainOfResponsibility, MarshallingContext context, ClassSource classSource, Object object, ArrayList codeLines)
           
protected  int arrayDimension(Class clazz)
           
protected  Class arrayType(Class clazz)
           
protected  String convertClassToInitializer(Object object)
           
 String convertTypeToSimpleType(Class clazz)
           
 String convertTypeToSourceCodeType(Class clazz)
           
abstract  boolean doesMarshal(Object object)
           
 String initialCap(String input)
           
 String marshal(ChainOfResponsibility chainOfResponsibility, MarshallingContext context, ClassSource classSource, Object object, boolean marshalAsObject)
           
 
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

CollectionMarshaller

public CollectionMarshaller()
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

convertTypeToSimpleType

public String convertTypeToSimpleType(Class clazz)

arrayDimension

protected int arrayDimension(Class clazz)

convertTypeToSourceCodeType

public String convertTypeToSourceCodeType(Class clazz)

initialCap

public String initialCap(String input)

convertClassToInitializer

protected String convertClassToInitializer(Object object)

arrayType

protected Class arrayType(Class clazz)

addItemsToReturnValue

protected abstract void addItemsToReturnValue(ChainOfResponsibility chainOfResponsibility,
                                              MarshallingContext context,
                                              ClassSource classSource,
                                              Object object,
                                              ArrayList codeLines)
                                       throws IOException,
                                              IllegalAccessException,
                                              InvocationTargetException,
                                              ClassNotFoundException,
                                              InstantiationException
IOException
IllegalAccessException
InvocationTargetException
ClassNotFoundException
InstantiationException