org.dishevelled.codegen
Class Codegen

java.lang.Object
  extended by org.dishevelled.codegen.Codegen

public final class Codegen
extends Object

Static source code generation methods.

Version:
$Revision: 994 $ $Date: 2011-02-25 15:37:32 -0600 (Fri, 25 Feb 2011) $
Author:
Michael Heuer

Method Summary
static void generateAbstractUnitTest(InterfaceDescription id)
          Generate an abstract unit test java source file for the specified interface description.
static void generateBuilderSource(ClassDescription cd, Style style)
          Generate a java source file for a fluent builder API for the specified class description and style.
static void generateEnum(ClassDescription cd)
          Generate an enum source file for the specified class description.
static void generateEnumWithLookup(ClassDescription cd)
          Generate an enum with lookup source file for the specified class description.
static void generateSource(ClassDescription cd, Style style)
          Generate a java source file for the specified class description and style.
static void generateSource(InterfaceDescription id)
          Generate a java source file for the specified interface description.
static void generateUnitTest(ClassDescription cd, Style style)
          Generate a unit test source file for the specified class description and style.
static String readLicense(String license)
          Read license text from the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readLicense

public static String readLicense(String license)
Read license text from the specified file.

Parameters:
license - license file to read
Returns:
license text from the specified file or null if the specified license file cannot be read

generateSource

public static void generateSource(InterfaceDescription id)
Generate a java source file for the specified interface description.

Parameters:
id - interface description, must not be null

generateAbstractUnitTest

public static void generateAbstractUnitTest(InterfaceDescription id)
Generate an abstract unit test java source file for the specified interface description.

Parameters:
id - interface description, must not be null

generateSource

public static void generateSource(ClassDescription cd,
                                  Style style)
Generate a java source file for the specified class description and style.

Parameters:
cd - class description, must not be null
style - style, must not be null

generateBuilderSource

public static void generateBuilderSource(ClassDescription cd,
                                         Style style)
Generate a java source file for a fluent builder API for the specified class description and style.

Parameters:
cd - class description, must not be null
style - style, must not be null

generateUnitTest

public static void generateUnitTest(ClassDescription cd,
                                    Style style)
Generate a unit test source file for the specified class description and style.

Parameters:
cd - class description, must not be null
style - style, must not be null

generateEnum

public static void generateEnum(ClassDescription cd)
Generate an enum source file for the specified class description.

Parameters:
cd - class description, must not be null

generateEnumWithLookup

public static void generateEnumWithLookup(ClassDescription cd)
Generate an enum with lookup source file for the specified class description.

Parameters:
cd - class description, must not be null


Copyright (c) 2004-2011 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).