|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.ProjectComponent org.apache.tools.ant.Task de.ispsoft.jaxme.generator.ant.JaxMeGeneratorTask
An Ant task for running a JaxMe generator. Usage is as follows:
<taskdef name="jaxme" classname="de.ispsoft.jaxme.generator.ant.JaxMeGeneratorTask"> <classpath/> <pathelement location="jaxme.jar"/> <pathelement location="log4j.jar"/6gt; </classpath/> </taskdef> <jaxme inputFile="myschema.xsd" destDir="build/src"> <sourceWriter className="de.ispsoft.jaxme.generator.JavaSourceWriter"/> </jaxme>The jaxme task supports the following attributes:
Name | Required | Description |
---|---|---|
inputFile | Either of inputFile or inputUrl | Name of the XML schema file |
inputURL | Either of inputFile or inputUrl | URL of the XML schema, if it's not a local file. |
destDir | No | Directory where to generate sources; subdirectories will be creaed to match a package structure |
destFile | No | If this option is present, then the modification time of the schema file will be compared with the modification time of the given destination file. If the latter is younger, then the JaxMe task does nothing. |
logLevel | No | Sets the logging level. Valid values are debug, info, warn (default) or error. |
force | No | If the task is generating a file which already exists and is different, then by default the modification times of schema file and and destination file are compared. An exception is thrown, if the latter is younger. The force option modifies this behaviour to overwrite the existing file in any case. |
Name | Attributes | Description |
---|---|---|
schemaReader | className | Sets the schemaReader class; defaults to de.ispsoft.jaxme.generator.XsdSchemaReader. |
sourceWriter | className | Adds a SourceWriter, for example de.ispsoft.jaxme.generator.JavaSourceWriter. |
option | name, target, value | Adds an option with the given name and value. The target is an optional class or interface name. If the target is missing, then the option applies to all objects. |
Field Summary |
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 | |
JaxMeGeneratorTask()
|
Method Summary | |
void |
addOption(OptionType pOption)
Adds an option. |
void |
addSourceWriter(SourceWriterType pSourceWriter)
Adds a SourceWriter. |
void |
clearOptions()
Clears the list of Options. |
void |
clearSourceWriters()
Clears the list of SourceWriters. |
SchemaReaderType |
createSchemaReader()
Sets the SchemaReader. |
void |
execute()
Performs the actual task. |
java.lang.String |
getDescription()
Returns the tasks description. |
java.io.File |
getDestDir()
Returns the destination directory. |
java.io.File |
getDestFile()
Returns the destination file. |
boolean |
getForce()
Returns whether to overwrite files. |
java.io.File |
getInputFile()
Returns the input file. |
java.net.URL |
getInputURL()
Returns the input URL. |
org.apache.log4j.Priority |
getLogLevel()
Returns the log level. |
java.util.Iterator |
getOptions()
Returns an iterator to the list of options. |
SchemaReaderType |
getSchemaReader()
Returns the configured SchemaReader. |
java.util.Iterator |
getSourceWriters()
Returns an iterator to the list of SourceWriters. |
void |
initLog4J()
Initializes the log4j logger, used by the JaxMe generator. |
void |
reset()
Resets the task for the next run. |
void |
setDestDir(java.io.File pDir)
Sets the destination directory. |
void |
setDestFile(java.io.File pDestFile)
Sets the destination file. |
void |
setForce(boolean pForce)
Sets whether to overwrite files. |
void |
setInputFile(java.io.File pInputFile)
Sets the input file. |
void |
setInputURL(java.net.URL pInputURL)
Sets the input URL. |
void |
setLogLevel(java.lang.String pLevel)
Sets the log level. |
void |
verify()
Verifies the tasks configuration. |
Methods inherited from class org.apache.tools.ant.Task |
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 JaxMeGeneratorTask()
Method Detail |
public java.lang.String getDescription()
Returns the tasks description.
public void setInputFile(java.io.File pInputFile)
Sets the input file.
public java.io.File getInputFile()
Returns the input file.
public void setLogLevel(java.lang.String pLevel)
Sets the log level.
public org.apache.log4j.Priority getLogLevel()
Returns the log level.
public void setInputURL(java.net.URL pInputURL)
Sets the input URL.
public java.net.URL getInputURL()
Returns the input URL.
public SchemaReaderType createSchemaReader()
Sets the SchemaReader.
public SchemaReaderType getSchemaReader()
Returns the configured SchemaReader.
public void clearSourceWriters()
Clears the list of SourceWriters.
public void addSourceWriter(SourceWriterType pSourceWriter)
Adds a SourceWriter.
public java.util.Iterator getSourceWriters()
Returns an iterator to the list of SourceWriters.
public void clearOptions()
Clears the list of Options.
public void addOption(OptionType pOption)
Adds an option.
public java.util.Iterator getOptions()
Returns an iterator to the list of options.
public boolean getForce()
Returns whether to overwrite files.
public void setForce(boolean pForce)
Sets whether to overwrite files.
public void setDestFile(java.io.File pDestFile)
Sets the destination file.
public java.io.File getDestFile()
Returns the destination file.
public void verify()
Verifies the tasks configuration.
public void setDestDir(java.io.File pDir)
Sets the destination directory.
public java.io.File getDestDir()
Returns the destination directory.
public void reset()
Resets the task for the next run.
public void initLog4J()
Initializes the log4j logger, used by the JaxMe generator.
public void execute() throws org.apache.tools.ant.BuildException
Performs the actual task.
org.apache.tools.ant.BuildException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |