ca.quine.jcommons.sourceexporter
Class SourceExporter

java.lang.Object
  |
  +--ca.quine.jcommons.sourceexporter.SourceExporter
Direct Known Subclasses:
CustomSourceExporter

public class SourceExporter
extends Object

Constructs a ChainOfResponsibility and exports (or "marshalls") objects to source code using it (this class is the main class in the SourceExporter package).


Field Summary
protected  ChainOfResponsibility chainOfResponsibility
           
 
Constructor Summary
SourceExporter()
           
 
Method Summary
protected  void addConfiguredMarshallers()
           
static void export(Object object, String filename)
           
protected static void export(SourceExporter exporter, Object object, String filename)
          This method is provided so that it can be used by a static export method in a subclass similar to export(Object, String) (since static methods cannot be overridden, only hidden).
 void export(String filename, String packageName, String testClassName, String className, String methodName, Object object)
           
 void export(String filename, String packageName, String testClassName, String className, String methodName, Object object, MarshallingContext context)
          Exports the given object to a Java source file with the given filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chainOfResponsibility

protected ChainOfResponsibility chainOfResponsibility
Constructor Detail

SourceExporter

public SourceExporter()
Method Detail

addConfiguredMarshallers

protected void addConfiguredMarshallers()

export

public void export(String filename,
                   String packageName,
                   String testClassName,
                   String className,
                   String methodName,
                   Object object)
            throws IllegalAccessException,
                   NoSuchFieldException,
                   ClassNotFoundException,
                   IOException,
                   IllegalArgumentException,
                   InvocationTargetException,
                   InstantiationException
IllegalAccessException
NoSuchFieldException
ClassNotFoundException
IOException
IllegalArgumentException
InvocationTargetException
InstantiationException

export

public void export(String filename,
                   String packageName,
                   String testClassName,
                   String className,
                   String methodName,
                   Object object,
                   MarshallingContext context)
            throws IllegalAccessException,
                   NoSuchFieldException,
                   ClassNotFoundException,
                   IOException,
                   IllegalArgumentException,
                   InvocationTargetException,
                   InstantiationException
Exports the given object to a Java source file with the given filename.

Parameters:
filename - the file name of the generated source code
packageName - the package to use for the generated file
testClassName - the class name of the public class in the generated file
className - the class name of the object (used for the return type of the method)
methodName - the method in the generated source code that will create and return the object
object - the object to export as source code
context - holds information and properties that keep track of and control source code generation (such as which objects have been seen so far and what code formatting style to use)
Throws:
IllegalAccessException
NoSuchFieldException
ClassNotFoundException
IOException
IllegalArgumentException
InvocationTargetException
InstantiationException

export

protected static void export(SourceExporter exporter,
                             Object object,
                             String filename)
                      throws IllegalArgumentException,
                             IllegalAccessException,
                             NoSuchFieldException,
                             ClassNotFoundException,
                             IOException,
                             InvocationTargetException,
                             InstantiationException
This method is provided so that it can be used by a static export method in a subclass similar to export(Object, String) (since static methods cannot be overridden, only hidden).

Parameters:
exporter -
object -
filename -
Throws:
IllegalArgumentException
IllegalAccessException
NoSuchFieldException
ClassNotFoundException
IOException
InvocationTargetException
InstantiationException

export

public static void export(Object object,
                          String filename)
                   throws IllegalArgumentException,
                          IllegalAccessException,
                          NoSuchFieldException,
                          ClassNotFoundException,
                          IOException,
                          InvocationTargetException,
                          InstantiationException
IllegalArgumentException
IllegalAccessException
NoSuchFieldException
ClassNotFoundException
IOException
InvocationTargetException
InstantiationException