Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
Task
org.apache.ws.jaxme.generator.XJCTask
public class XJCTask
extends Task
Name | Description | Required/Default |
---|---|---|
schema | Name of a schema file being compiled | This or nested <schema> elements are required |
binding | An external binding file being applied to the schema file | No |
force | Setting this option to true forces the up-to-date check to fail. This option is mainly useful while working on the JaxMe generator. For JaxMe users, which only change schema files, this option isn't of much use. It is designed for JaxMe developers. | No, false |
package | Specifies the generated Java sources package name. Overrides package specifications in the schema bindings, if any. | No, a package may be specified in the schema bindings. |
target | Specifies the target directory for generated Java source files. A package structure will be created below that directory. For example, with target="src" and package="org.acme", you will have files being created in "src/org/acme". | No, defaults to the current directory |
resourceTarget | Specifies the target directory for generated resource files. A package structure will be created below that directory. For example, with target="src" and package="org.acme", you will have files being created in "src/org/acme". | No, defaults to the "target" directory |
readonly | Generated Java source files are in read-only mode, if true is specified | No, defaults to false |
extension | If set to true, the XJC binding compiler will run in the extension mode. Otherwise, it will run in the strict conformance mode. | No, defaults to false |
stackSize | Specify the thread stack size for the XJC binding compiler (J2SE SDK v1.4 or higher).
The XJC binding compiler can fail to compile large schemas with StackOverflowError and,
in that case, this option can be used to extend the stack size. If unspecified, the default
VM size is used. The format is equivalent to the -Xss command-line argument for Sun Microsystems JVM.
This value can be specified in bytes (stackSize="2097152"), kilobytes (stackSize="2048kb"),
or megabytes (stackSize="2mb"). This attribute is ignored by the JaxMe ant task and present for compatibility reasons only. | No, defaults to false |
removeOldOutput | If one or more nested <produces> elements are specified and this attribute is set to true, then the Ant task will ensure that only generated files will remain. In other words, if you had removed an element named "Foo" from the previous schema version, then the Ant task will remove "Foo.java". | No, defaults to false |
validating | Sets whether the XML schema parser is validating. By default it isn't. | No, defaults to false |
Name | Description | Required/Multiplicity |
---|---|---|
schema | Multiple schema files may be compiled in one or more nested <schema> elements. The element syntax is equivalent to a nested <fileset>. Use of a nested <schema> element is mutually exclusive with the use of a "schema" attribute. | 0 - Unbounded |
binding | Multiple external binding files may be specified. The element syntax is equivalent to a nested <fileset>. Use of a nested <binding> element is mutually exclusive with the use of a "binding" attribute. | 0 - Unbounded |
classpath | This nested element is ignored by the JaxMe ant task and exists for compatibility to the JAXB ant task only. In the case of JAXB it specifies a classpath for loading user defined types (required in the case of a <javaType> customization) | 0 - Unbounded |
arg | This nested element is ignored by the JaxMe ant task and exists for compatibility
to the JAXB ant task only. In the case of JAXB it specifies additional command line
arguments being passed to the XJC. For details about the syntax, see the relevant
section in the Ant manual. This nested element can be used to specify various options not natively supported in the xjc Ant task. For example, currently there is no native support for the following xjc command-line options:
| 0 - Unbounded |
dtd | If this nested element is used to specify, that the input files aren't instances of XML Schema, but DTD's. The nested element may have an attribute "targetNamespace", which specifies an optional target namespace. | No |
depends | By default the JaxMe Ant tasks up-to-date check considers the specified schema
and binding files only. This is insufficient, if other schema files are included,
imported or redefined. The nested <depends> element allows to specify additional files to consider for the up-to-date check. Typically these are the additional schema files. Syntactically the <depends> element specifies a nested <fileset>. | 0 - Unbounded |
produces | Specifies the set of files being created by the JaxMe ant task. These files are considered as targets for the up-to-date check. The syntax of the <produces> element is equivalent to a nested <fileset>. However, you typically do not need to set the "dir" attribute, because it defaults to the target directory. | 0 - Unbounded |
property | Sets a property value. These properties may be used by the various source generators to configure the behaviour. For example, the JDBC schema reader uses the options "jdbc.driver", "jdbc.url", "jdbc.user", and "jdbc.password" to configure the database connection. Each property must have attributes "name" (the property name) and "value" (the property value). | 0 - Unbounded |
schemaReader | Configures the schema reader to use. Defaults to "org.apache.ws.jaxme.generator.sg.impl.JAXBSchemaReader", which is the JAXB compliant schema reader. An alternative schema readers is, for example, "org.apache.ws.jaxme.generator.sg.impl.JaxMeSchemaReader" (a subclass of JAXBSchemaReader with JaxMe specific extensions). | 0 - 1 |
sgFactoryChain | If the schema reader is an instance of
JAXBSchemaReader , then you may
add instances of SGFactoryChain to
the schema generation process. For example, such chains are used to create
the persistency layer. The best example is the
JaxMeJdbcSG , which is able to
populate the schema with tables and columns read from a database via
JDBC metadata. | 0 - Unbounded |
xmlCatalog | Adds an XML catalog to our internal catalog, which is used to resolve external entities and URI's. See the Ant documentation for details on XML catalogs. | 0 - Unbounded |
Nested Class Summary | |
static class | |
static class |
|
class | |
static class |
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
XJCTask.Dtd |
|
FileSet |
|
XJCTask.Property |
|
XJCTask.ClassType |
|
XJCTask.ClassType |
|
void |
|
void |
|
File |
|
FileSet[] |
|
FileSet[] |
|
String |
|
XJCTask.Dtd |
|
String |
|
FileSet[] |
|
XJCTask.Property[] |
|
File |
|
XJCTask.ClassType[] |
|
File |
|
SchemaReader |
|
FileSet[] |
|
String |
|
File |
|
void |
|
LoggerFactory | |
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
public void addArg(Commandline.Argument pArg)
This nested element is ignored by the JaxMe ant task and exists for compatibility to the JAXB ant task only. In the case of JAXB it specifies additional command line arguments being passed to the XJC. For details about the syntax, see the relevant section in the Ant manual.
This nested element can be used to specify various options not natively supported in the xjc Ant task. For example, currently there is no native support for the following xjc command-line options:
- -nv
- -catalog
- -use-runtime
- -schema
- -dtd
- -relaxng
public void addBinding(FileSet pBindings)
Multiple external binding files may be specified. The element syntax is equivalent to a nested <fileset>. Use of a nested <binding> element is mutually exclusive with the use of a "binding" attribute.
public void addClasspath(Path pClasspath)
This nested element is ignored by the JaxMe ant task and exists for compatibility to the JAXB ant task only. In the case of JAXB it specifies a classpath for loading user defined types (required in the case of a <javaType> customization)
public void addConfiguredXMLCatalog(XMLCatalog pXmlCatalog)
Adds an XML catalog to our internal catalog. See the Ant documentation for details on XML catalogs.
- Parameters:
public void addDepends(FileSet pDepends)
By default the JaxMe Ant tasks up-to-date check considers the specified schema and binding files only. This is insufficient, if other schema files are included, imported or redefined.
The nested <depends> element allows to specify additional files to consider for the up-to-date check. Typically these are the additional schema files.
Syntactically the <depends> element specifies a nested <fileset>.
public void addSchema(FileSet pSchemas)
Multiple schema files may be compiled in one or more nested <schema> elements. The element syntax is equivalent to a nested <fileset>. Use of a nested <schema> element is mutually exclusive with the use of a "schema" attribute.
public FileSet createProduces()
Specifies the set of files being created by the JaxMe ant task. These files are considered as targets for the up-to-date check. The syntax of the <produces> element is equivalent to a nested <fileset>.
public XJCTask.Property createProperty()
Sets a property value. These properties may be used by the various source generators to configure the behaviour. For example, the JDBC schema reader uses the options "jdbc.driver", "jdbc.url", "jdbc.user", and "jdbc.password" to configure the database connection. Each property must have attributes "name" (the property name) and "value" (the property value).
public XJCTask.ClassType createSGFactoryChain()
Configures a new instance ofSGFactoryChain
being included into the schema generation process. This option is valid only, if the schema reader is an instance ofJAXBSchemaReader
, because its methodJAXBSchemaReader.addSGFactoryChain(Class)
must be invoked. The order of the chain elements may be significant. The schema reader itself will always be the last element in the chain.
public XJCTask.ClassType createSchemaReader()
Configures the schema reader to use. Defaults to "org.apache.ws.jaxme.generator.sg.impl.JAXBSchemaReader", which is the JAXB compliant schema reader. An alternative schema readers is, for example, "org.apache.ws.jaxme.generator.sg.impl.JaxMeSchemaReader" (a subclass of JAXBSchemaReader with JaxMe specific extensions).
public void execute()
public void finish()
public File getBinding()
Returns an external binding file being applied to the schema file.
public FileSet[] getBindings()
Multiple external binding files may be specified. The element syntax is equivalent to a nested <fileset>. Use of a nested <binding> element is mutually exclusive with the use of a "binding" attribute.
public FileSet[] getDepends()
By default the JaxMe Ant tasks up-to-date check considers the specified schema and binding files only. This is insufficient, if other schema files are included, imported or redefined.
The nested <depends> element allows to specify additional files to consider for the up-to-date check. Typically these are the additional schema files.
Syntactically the <depends> element specifies a nested <fileset>.
public String getDescription()
Returns the ant tasks description.
public String getPackage()
Returns the generated Java sources package name. A non-null package specification overrides package specifications in the schema bindings, if any.
public FileSet[] getProduces()
Returns the set of files being created by the JaxMe ant task. These files are considered as targets for the up-to-date check. The syntax of the <produces> element is equivalent to a nested <fileset>.
public XJCTask.Property[] getProperties()
Returns the configured property values. These properties may be used by the various source generators to configure the behaviour. For example, the JDBC schema reader uses the options "jdbc.driver", "jdbc.url", "jdbc.user", and "jdbc.password" to configure the database connection. Each property must have attributes "name" (the property name) and "value" (the property value).
public File getResourceTarget()
Returns the target directory for generating resource files. A package structure will be created below that directory. For example, with target="src" and package="org.acme", you will have files being created in "src/org/acme". By default, the same directory is being used for Java source files and resource files.
public XJCTask.ClassType[] getSGFactoryChains()
Returns the array of configured instances ofSGFactoryChain
. The order of the array is significant. The schema reader itself will always be the last element in the chain. Therefore, it is not present in the array.
public File getSchema()
Returns the name of the schema file being compiled.
public SchemaReader getSchemaReader()
Returns the configured schema reader to use. Defaults to "org.apache.ws.jaxme.generator.sg.impl.JAXBSchemaReader", which is the JAXB compliant schema reader. An alternative schema readers is, for example, "org.apache.ws.jaxme.generator.sg.impl.JaxMeSchemaReader" (a subclass of JAXBSchemaReader with JaxMe specific extensions).
public FileSet[] getSchemas()
Multiple schema files may be compiled in one or more nested <schema> elements. The element syntax is equivalent to a nested <fileset>. Use of a nested <schema> element is mutually exclusive with the use of a "schema" attribute.
public String getStackSize()
Returns the thread stack size for the XJC binding compiler (J2SE SDK v1.4 or higher). The XJC binding compiler can fail to compile large schemas with StackOverflowError and, in that case, this option can be used to extend the stack size. If unspecified, the default VM size is used. The format is equivalent to the -Xss command-line argument for Sun Microsystems JVM. This value can be specified in bytes (stackSize="2097152"), kilobytes (stackSize="2048kb"), or megabytes (stackSize="2mb"). This attribute is ignored by the JaxMe ant task and present for compatibility reasons only.
public File getTarget()
Returns the target directory for generating Java source files. A package structure will be created below that directory. For example, with target="src" and package="org.acme", you will have files being created in "src/org/acme".
public void init()
Initialize internal instance of XMLCatalog
public boolean isExtension()
Returns, whether the XJC binding compiler will run in the extension mode. By default, it will run in the strict conformance mode.
public boolean isForce()
Setting this option to true forces the up-to-date check to fail. This option is mainly useful while working on the JaxMe generator. For JaxMe users, which only change schema files, this option isn't of much use. It is designed for JaxMe developers.
public boolean isReadOnly()
Returns, whether generated Java source files are in read-only mode.
public boolean isRemoveOldOutput()
If one or more nested <produces> elements are specified and this attribute is set to true, then the Ant task will ensure that only generated files will remain. In other words, if you had removed an element named "Foo" from the previous schema version, then the Ant task will remove "Foo.java".
public boolean isSettingLoggerFactory()
Returns whether the ant task is setting theLoggerFactory
. This option is only useful, if you are using the Ant task from another Java class and not from within Ant.
public boolean isUpToDate(File[] pSchemaFiles, File[] pBindingFiles, File[] pDependsFiles, List pProducesList)
public boolean isValidating()
Returns whether the XML schema parser is validating.
public void setBinding(File pBinding)
Sets an external binding file being applied to the schema file.
public void setExtension(boolean pExtension)
Sets, whether the XJC binding compiler will run in the extension mode. By default, it will run in the strict conformance mode.
public void setForce(boolean pForce)
Setting this option to true forces the up-to-date check to fail. This option is mainly useful while working on the JaxMe generator. For JaxMe users, which only change schema files, this option isn't of much use. It is designed for JaxMe developers.
public void setPackage(String pPackageName)
Sets the generated Java sources package name. A non-null package specification overrides package specifications in the schema bindings, if any.
public void setReadOnly(boolean pReadOnly)
Sets, whether generated Java source files are in read-only mode.
public void setRemoveOldOutput(boolean pRemoveOldOutput)
If one or more nested <produces> elements are specified and this attribute is set to true, then the Ant task will ensure that only generated files will remain. In other words, if you had removed an element named "Foo" from the previous schema version, then the Ant task will remove "Foo.java".
public void setResourceTarget(File pTarget)
Sets the target directory for generating resource files. A package structure will be created below that directory. For example, with target="src" and package="org.acme", you will have files being created in "src/org/acme". By default, the same directory is being used for Java source files and resource files.
public void setSchema(File pSchema)
Sets the name of the schema file being compiled.
public void setSettingLoggerFactory(boolean pIsSettingLoggerFactory)
Sets whether the ant task is setting theLoggerFactory
. This option is only useful, if you are using the Ant task from another Java class and not from within Ant.
public void setStackSize(String pStackSize)
Sets the thread stack size for the XJC binding compiler (J2SE SDK v1.4 or higher). The XJC binding compiler can fail to compile large schemas with StackOverflowError and, in that case, this option can be used to extend the stack size. If unspecified, the default VM size is used. The format is equivalent to the -Xss command-line argument for Sun Microsystems JVM. This value can be specified in bytes (stackSize="2097152"), kilobytes (stackSize="2048kb"), or megabytes (stackSize="2mb"). This attribute is ignored by the JaxMe ant task and present for compatibility reasons only.
public void setTarget(File pTarget)
Sets the target directory for generating Java source files. A package structure will be created below that directory. For example, with target="src" and package="org.acme", you will have files being created in "src/org/acme".
public void setValidating(boolean pValidating)
Sets whether the XML schema parser is validating.