|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is a standalone "utility" interface. It allows source code generation from a set of XML constraints. It also allows for providing a standard set of methods that all utility source code generation classes should provide (at a minimum).
Method Summary | |
void |
generate()
This method performs class generation. |
void |
setCollapseSimpleElements(boolean collapseSimpleElements)
This method allows the developer to specify that all simple XML elements (elements with #PCDATA content) should map to data
members on parent member classes rather than their
own classes. |
void |
setConstraintsInput(java.io.File file)
This allows for supplying the constraints file to use for source code generation as a File . |
void |
setConstraintsInput(java.io.InputStream inputStream)
This allows for supplying the constraints file to use for source code generation as an InputStream . |
void |
setConstraintsInput(java.io.Reader reader)
This allows for supplying the constraints file to use for source code generation as a FileReader . |
void |
setConstraintsInput(java.lang.String fileURI)
This allows for supplying the constraints file to use for source code generation as a String URI. |
void |
setGenerateAsSerializable(boolean generateAsSerializable)
This will set whether or not to set source code classes as serializable (implementing java.io.Serializable . |
void |
setInterfacePackage(java.lang.String interfacePackage)
Sets the Java package to generate new interfaces within. |
void |
setJavaPackage(java.lang.String javaPackage)
This will set the package for generating classes within. |
void |
setNamePrefix(java.lang.String namePrefix)
This method allows the developer to set a prefix that will be prepended to the name of every generated interface and class. |
void |
setOutputDir(java.io.File outputDir)
This allows specification of an output directory for the generated classes. |
void |
setOutputDir(java.lang.String outputDir)
This allows specification of an output directory for the generated classes. |
Method Detail |
public void setConstraintsInput(java.lang.String fileURI) throws java.io.IOException
This allows for supplying the constraints file to use
for source code generation as a String
URI.
fileURI
- String
URI for constraints file.IOException
- - when the specified file URI
is invalid.public void setConstraintsInput(java.io.File file) throws java.io.IOException
This allows for supplying the constraints file to use
for source code generation as a File
.
file
- File
to read constraints from.IOException
- - when the specified file URI
is invalid.public void setConstraintsInput(java.io.Reader reader)
This allows for supplying the constraints file to use
for source code generation as a FileReader
.
reader
- Reader
to read constraints
from.public void setConstraintsInput(java.io.InputStream inputStream)
This allows for supplying the constraints file to use
for source code generation as an
InputStream
.
inputStream
- InputStream
to read
constraints from.public void setOutputDir(java.lang.String outputDir) throws java.io.IOException
This allows specification of an output directory for the generated classes.
outputDir
- String
specifying output directory
for generated classes.public void setOutputDir(java.io.File outputDir) throws java.io.IOException
This allows specification of an output directory for the generated classes.
outputDir
- File
specifying output directory
for generated classes.public void setJavaPackage(java.lang.String javaPackage)
This will set the package for generating classes within.
javaPackage
- the package to generate classes within.public void setInterfacePackage(java.lang.String interfacePackage)
Sets the Java package to generate new interfaces within. For example, supplying the value com.foo.bar to this method and then generating classes, the interfaces would all be in the com.foo.bar package after generation.
interfacePackage
- String
the Java package to
generate interfaces within.public void setNamePrefix(java.lang.String namePrefix)
This method allows the developer to set a prefix that will be prepended to the name of every generated interface and class.
String
- prefix that will be prepended to the
name of every generated interface and classpublic void setCollapseSimpleElements(boolean collapseSimpleElements)
This method allows the developer to specify that all
simple XML elements (elements with
#PCDATA
content) should map to data
members on parent member classes rather than their
own classes.
collapseSimpleElements
- true if simple elements
should be collapsedpublic void setGenerateAsSerializable(boolean generateAsSerializable)
This will set whether or not to set source code classes as
serializable (implementing java.io.Serializable
.
generateAsSerializable
- boolean
indicating
whether to generate the source code as serializable.public void generate() throws java.io.IOException
This method performs class generation.
IOException
- - when class generation fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |