|
|||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Class Summary | |
EnumInfo | Holds information for creating an Enum. |
EnumInfoBuilder | Gathers up the info and constructs an EnumInfo object for an EnumSourceBuilder. |
EnumSourceBuilder | Builds the Enums from an XML spec into .java source files. |
Main | A class to hold the main() method and get things started. |
SingletonInfo | Holds information for creating a Singleton. |
This package contains a simple code generator to create Enums quickly from XML files. A successful run of this tool creates a single Enum as a Singleton. That Enum implementation contains the Members as inner classes that are also Singletons. It adds public static accessors for all of the Member instances as well.
To use this tool from the command line, type:
java -classpath walend-enum-generator.jar:walend-enum.jar:velocity-dep-1.3.1-rc2.jar net.walend.enum.generator.Main
The primary entry point for the command line is net.walend.enum.generator.Main, which takes two command line arguments: the input xml file and the output .java source file. Main's main() method consists of good error handling code, plus a call to the doIt() method, which does all the work.
Other classes in order of most interest are EnumInfo, which holds all the info needed to create an enum, EnumSourceBuilder, which takes an EnumInfo object and constructs a .java source file and EnumInfoBuilder, which builds an EnumInfo object from an xml file using a dom. SingletonInfo is EnumInfo's superclass, and holds information needed to create the Members of the Enum.
|
|||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |