|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.ProjectComponent | +--org.apache.tools.ant.Task | +--org.enhydra.zeus.util.ZeusTask
ZeusTask
is an Ant Task
for generating Java
source files from a set of constraints. Please refer to the
Ant website
for more information. The supported tags are as follows:
The zeus
element is the top-level element used to initiate
data binding using Zeus. It specifies global options for all constraint
generation processes initiated within it (each using the constraint
element, see below).
<zeus> Tag
attribute | required | default value | description |
---|---|---|---|
srcDir | no | [Current Working Directory] | The base directory for constraint files |
destDir | yes | N/A | The directory in which generated Java source files should be placed. Note that this will be the base directory, and directories equivalent to the package-level of the generated source code will be nested within this base. |
defaultJavaPackage | no | "" | The Java package to use on all constraint generation processes
where an explicit Java package is not supplied (using the
javaPackage attribute on the constraint
element, see below). |
The constraint
element can be nested inside the zeus
element, one or more times. This is used to specify a single constraint generation
process (the conversion from one constraint file to one or more Java source
files). All options specified here override the default options specified on
the zeus
element.
<constraint> Tag
attribute | required | default value | description |
---|---|---|---|
type | yes | N/A | The type of constraint being supplied. Currently, only DTD is supported, with XSD (XML Schema) in an alpha state. |
constraintFile | yes | N/A | The path (working from the sourceDir path, specified
in the zeus element) to the constraint file to generate
source code from. |
javaPackage | no | "" | The Java package in which to place generated source code. This overrides
any value supplied in the defaultJavaPackage attribute on
the zeus element.) |
collapseSimpleElements | no | false | Whether or not to collapse simple elements. A simple element is one
in which there is only character content; there are no attributes, and
no nested elements. Collapsing these elements results in properties
that access the simple element's content as get[ElementName]()
instead of get[ElementName]().getValue() . |
ignoreIDAttributes | no | false | Whether or not to ignore ID attributes in deterimining if an element is simple. When IDREFs are used, most elements have ID attributes that have no functional meaning. This allows elements with just an ID attribute to still be collapsed as simple elements. |
Inner Class Summary | |
class |
ZeusTask.Constraint
Constraint is an inner class used to represent a single
constraint element (constraint ). |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
ZeusTask()
This default constructor sets up task defaults. |
Method Summary | |
ZeusTask.Constraint |
createConstraint()
This will create a new Ant Constraint , add it to the list
of Ant constraints, and return the newly created
Constraint . |
void |
execute()
This will handle task execution pre-processing tasks. |
void |
generateFrom(ZeusTask.Constraint constraint)
|
java.lang.String |
getDefaultJavaPackage()
This will indicate the Java package used for generated source files by default (if no other package is specified for a specific binding). |
java.io.File |
getDestDir()
This will return the destination directory in which Java source files are generated. |
java.io.File |
getSourceDir()
This will return the Java File object representing the
source directory for constraints. |
void |
setDefaultCollapseSimpleElements(boolean defaultCollapseSimpleElements)
This will set whether simple elements or collapsed, in the default case (when a specific constraint generation does not override it). |
void |
setDefaultJavaPackage(java.lang.String defaultJavaPackage)
This sets the Java package to use for generated source files in the default case (unless overridden by a specific generation process). |
void |
setDestDir(java.io.File destDir)
This will set the destination directory to use for outputting Java source files within. |
void |
setSourceDir(java.io.File sourceDir)
This sets the source directory to use as a base directory for resolving specified constraints. |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ZeusTask()
This default constructor sets up task defaults.
Method Detail |
public void execute() throws org.apache.tools.ant.BuildException
This will handle task execution pre-processing tasks. It processes these parameters:
BuildException
will result.execute
in class org.apache.tools.ant.Task
BuildException
- - when errors occur in processing the
task.public java.io.File getSourceDir()
This will return the Java File
object representing the
source directory for constraints.
File
- the source directory for constraints.public void setSourceDir(java.io.File sourceDir)
This sets the source directory to use as a base directory for resolving specified constraints.
sourceDir
- the File
representing the source directory.public java.io.File getDestDir()
This will return the destination directory in which Java source files are generated.
File
- the output directory.public void setDestDir(java.io.File destDir)
This will set the destination directory to use for outputting Java source files within.
destDir
- File
object for destination directory.public java.lang.String getDefaultJavaPackage()
This will indicate the Java package used for generated source files by default (if no other package is specified for a specific binding).
String
- the Java package used by default.public void setDefaultJavaPackage(java.lang.String defaultJavaPackage)
This sets the Java package to use for generated source files in the default case (unless overridden by a specific generation process).
defaultJavaPackage
- the Java package for generated classes.public void setDefaultCollapseSimpleElements(boolean defaultCollapseSimpleElements)
This will set whether simple elements or collapsed, in the default case (when a specific constraint generation does not override it).
defaultCollapseSimpleElements
- whether to collapse simple elements.public ZeusTask.Constraint createConstraint()
This will create a new Ant Constraint
, add it to the list
of Ant constraints, and return the newly created
Constraint
.
Constraint
- the created constraint.public void generateFrom(ZeusTask.Constraint constraint) throws org.apache.tools.ant.BuildException
constraint
- org.apache.tools.ant.BuildException
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |