|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.jvnet.ws.wadl2java.WJCTask
public class WJCTask
Ant task implementation for the WADL to Java tool
Use as an ant task:
<property name="jaxws.home" value="/path/to/jax-ws/directory" />
<property name="wadl2java.home" value="/path/to/wadl2java/directory" />
<taskdef name="wjc" classname="org.jvnet.ws.wadl2java.WJCTask">
<classpath>
<fileset dir="${jaxws.home}" includes="lib/*.jar" />
<pathelement location="${wadl2java.home}/dist/wadl2java.jar"/>
</classpath>
</taskdef>
<target name="-pre-compile">
<echo message="Compiling the description..." />
<wjc description="file.wadl" package="com.yahoo.search"
autoSchemaPackage="true|false" target="gen-src">
<customizations dir="." includes="binding.xjc"/>
<produces dir="gen-src/com/yahoo/search" includes="*.java"/>
<depends dir="." includes="schema.xsd"/>
<customClassName uri="http://yahoo.com/rest" classname="YahooRest" />
</wjc>
</target>
| Nested Class Summary | |
|---|---|
class |
WJCTask.ClassNameMapper
|
| Field Summary |
|---|
| Fields inherited from class org.apache.tools.ant.Task |
|---|
description, location, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
project |
| Constructor Summary | |
|---|---|
WJCTask()
Default constructor for WJCTask |
|
| Method Summary | |
|---|---|
void |
addConfiguredCustomizations(org.apache.tools.ant.types.FileSet fileset)
Add a pre-configured FileSet for a produces child element. |
void |
addConfiguredDepends(org.apache.tools.ant.types.FileSet fileset)
Add a pre-configured FileSet for a depends child element. |
void |
addConfiguredProduces(org.apache.tools.ant.types.FileSet fileset)
Add a pre-configured FileSet for a produces child element. |
WJCTask.ClassNameMapper |
createCustomClassName()
This option allows the caller to override the name of the class being generated for a particular root URI. |
void |
execute()
Processes the previously set WADL file and generated code in the specified package and target directory. |
void |
init()
Initializes the task ready to process a WADL file. |
void |
setAutoSchemaPackage(boolean auto)
Controls whether packages for classes generated from schemas are automatic (true) or use the package specified for endpoint classes. |
void |
setDescription(URI desc)
Sets the WADL file to be processed. |
void |
setPackage(String pkg)
Set the package in which generates code will be placed. |
void |
setTarget(File target)
Set the directory in which generated code will be placed. |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| 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 WJCTask()
| Method Detail |
|---|
public WJCTask.ClassNameMapper createCustomClassName()
public void setPackage(String pkg)
-p package option.
pkg - the package in which to generate code, e.g. 'org.example.test'.public void setAutoSchemaPackage(boolean auto)
-a option.
auto - whether package for schema classes should be autogenerated.public void setDescription(URI desc)
desc - the WADL file to be processed.public void setTarget(File target)
-o directory option.
target - the directory in which generated code will be written. E.g. if target
is gen-src and package is org.example.test
then generated code will be written to gen-src/org/example/test.
target must exist, subdirectories will be created as required.public void addConfiguredProduces(org.apache.tools.ant.types.FileSet fileset)
produces child element.
The fileset defines a set of files produced by this task and is used
in an up-to-date check when deciding if the WADL description should be
compiled or not.
fileset - the pre-configured FileSet objectpublic void addConfiguredCustomizations(org.apache.tools.ant.types.FileSet fileset)
produces child element.
The fileset defines a set of files produced by this task and is used
in an up-to-date check when deciding if the WADL description should be
compiled or not.
fileset - the pre-configured FileSet objectpublic void addConfiguredDepends(org.apache.tools.ant.types.FileSet fileset)
depends child element.
The fileset defines a set of files used by this task and is used
in an up-to-date check when deciding if the WADL description should be
compiled or not. The description file is automatically included in the
up-to-date check and doesn't need to be specified separately.
fileset - the pre-configured FileSet object
public void init()
throws org.apache.tools.ant.BuildException
init in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildException - if an error occurs during initialization.
public void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildException - if processing of the WADL file fails.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||