com.sun.tools.ws.ant
Class WsGen2

java.lang.Object
  extended by MatchingTask
      extended by com.sun.tools.ws.ant.WsGen2

public class WsGen2
extends MatchingTask

wsgen task for use with the JAXWS project.


Nested Class Summary
static class WsGen2.ExternalMetadata
           
 
Field Summary
protected  Path compileClasspath
          ********************** -classpath option ************************
protected  boolean inlineSchemas
          ***************** -inlineSchemas option *********************
 
Constructor Summary
WsGen2()
           
 
Method Summary
 Path createClasspath()
          Creates a nested classpath element.
 WsGen2.ExternalMetadata createExternalMetadata()
           
 Commandline.Argument createJavacarg()
          Adds Javac argument.
 Commandline.Argument createJvmarg()
          Adds a JVM argument.
 void execute()
          Called by the project to let the task do it's work *
protected  void execute(String tool, String toolClass)
          Let the task do it's work.
 Path getClasspath()
          Gets the classpath.
 Path getCP()
          Gets the classpath.
 boolean getDebug()
          Gets the debug flag.
 File getDestdir()
          Gets the base directory to output generated class.
 String getEncoding()
          Gets the encoding for generated source java files.
 boolean getExtension()
          Gets the "extension" flag.
 boolean getFork()
          Gets the "fork" flag.
 boolean getGenwsdl()
          Gets the genWsdl flag.
 boolean getIncludeantruntime()
          Gets whether or not the ant classpath is to be included in the task's classpath.
 boolean getIncludejavaruntime()
          Gets whether or not the java runtime should be included in this task's classpath.
 boolean getInlineSchemas()
          Gets the "inlineSchemas" flag.
 Commandline getJavacargs()
           
 boolean getKeep()
          Gets the "keep" flag.
 String getPortname()
          Gets the portName.
 String getProtocol()
          Gets the protocol.
 File getResourcedestdir()
          Gets the directory for non-class generated files.
 String getSei()
           
 String getServicename()
          Gets the serviceName.
 File getSourcedestdir()
          Gets the directory to place generated source java files.
 boolean getVerbose()
          Gets the "verbose" flag.
 boolean isFailonerror()
           
 boolean isXendorsed()
           
 boolean isXnocompile()
           
protected  boolean runInVm(String[] arguments, OutputStream out)
          Used to call the tool directly using API.
 void setClasspath(Path classpath)
          Set the classpath to be used for this compilation.
 void setClasspathRef(Reference r)
          Adds a reference to a CLASSPATH defined elsewhere.
 void setCP(Path classpath)
          Set the classpath to be used for this compilation.
 void setDebug(boolean debug)
          Sets the debug flag.
 void setDestdir(File base)
          Sets the base directory to output generated class.
 void setEncoding(String encoding)
          Sets the encoding for generated source java files.
 void setExtension(boolean extension)
          Sets the "extension" flag.
 void setFailonerror(boolean value)
          Mostly for our SQE teams and not to be advertised.
 void setFork(boolean fork)
          Sets the "fork" flag.
 void setGenwsdl(boolean genWsdl)
          Sets the genWsdl flag.
 void setIncludeantruntime(boolean include)
          Include ant's own classpath in this task's classpath?
 void setIncludejavaruntime(boolean include)
          Sets whether or not to include the java runtime libraries to this task's classpath.
 void setInlineSchemas(boolean inlineSchemas)
          Sets the "inlineSchemas" flag.
 void setKeep(boolean keep)
          Sets the "keep" flag.
 void setPortname(String name)
          Sets the serviceName.
 void setProtocol(String protocol)
          Sets the protocol.
 void setResourcedestdir(File resourceDir)
          Sets the directory for non-class generated files.
 void setSei(String endpointImplementationClass)
          Set SEI.
 void setServicename(String name)
          Sets the serviceName.
 void setSourcedestdir(File sourceBase)
          Sets the directory to place generated source java files.
protected  CommandlineJava setupCommand()
          Set up command line to invoke.
 void setVerbose(boolean verbose)
          Sets the "verbose" flag.
 void setXendorsed(boolean xendorsed)
           
 void setXnocompile(boolean xnocompile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

compileClasspath

protected Path compileClasspath
********************** -classpath option ************************


inlineSchemas

protected boolean inlineSchemas
***************** -inlineSchemas option *********************

Constructor Detail

WsGen2

public WsGen2()
Method Detail

getClasspath

public Path getClasspath()
Gets the classpath.

Returns:
user defined classpath.

setClasspath

public void setClasspath(Path classpath)
Set the classpath to be used for this compilation.

Parameters:
classpath - user defined classpath.

createClasspath

public Path createClasspath()
Creates a nested classpath element.

Returns:
classpath created.

setClasspathRef

public void setClasspathRef(Reference r)
Adds a reference to a CLASSPATH defined elsewhere.

Parameters:
r - classpath reference.

getCP

public Path getCP()
Gets the classpath.

Returns:
user defined classpath.

setCP

public void setCP(Path classpath)
Set the classpath to be used for this compilation.

Parameters:
classpath - user defined classpath.

getInlineSchemas

public boolean getInlineSchemas()
Gets the "inlineSchemas" flag.

Returns:
true if schema should be inlined in a WSDL.

setInlineSchemas

public void setInlineSchemas(boolean inlineSchemas)
Sets the "inlineSchemas" flag.

Parameters:
inlineSchemas - true to inline schema in a WSDL.

getResourcedestdir

public File getResourcedestdir()
Gets the directory for non-class generated files.

Returns:
destination directory for generated resource(s).

setResourcedestdir

public void setResourcedestdir(File resourceDir)
Sets the directory for non-class generated files.

Parameters:
resourceDir - destination directory for generated resource(s).

getGenwsdl

public boolean getGenwsdl()
Gets the genWsdl flag.

Returns:
true if WSDL should be generated.

setGenwsdl

public void setGenwsdl(boolean genWsdl)
Sets the genWsdl flag.

Parameters:
genWsdl - true to generate a WSDL.

getProtocol

public String getProtocol()
Gets the protocol.

Returns:
protocol.

setProtocol

public void setProtocol(String protocol)
Sets the protocol.

Parameters:
protocol - protocol.

getServicename

public String getServicename()
Gets the serviceName.

Returns:
service name.

setServicename

public void setServicename(String name)
Sets the serviceName.

Parameters:
name - service name.

getPortname

public String getPortname()
Gets the portName.

Returns:
port name.

setPortname

public void setPortname(String name)
Sets the serviceName.

Parameters:
name - port name.

getSei

public String getSei()
Returns:
Returns the sei.

setSei

public void setSei(String endpointImplementationClass)
Set SEI.

Parameters:
endpointImplementationClass - SEI.

setupCommand

protected CommandlineJava setupCommand()
Set up command line to invoke.

Returns:
ready to run command line

execute

public void execute()
             throws BuildException
Called by the project to let the task do it's work *

Throws:
BuildException

runInVm

protected boolean runInVm(String[] arguments,
                          OutputStream out)
Used to call the tool directly using API.

Parameters:
arguments - arguments to be passed to the tool
out - output for the tool
Returns:
true if tool succeed

createExternalMetadata

public WsGen2.ExternalMetadata createExternalMetadata()

getDestdir

public File getDestdir()
Gets the base directory to output generated class.

Returns:
destination directory for generated class(es).

setDestdir

public void setDestdir(File base)
Sets the base directory to output generated class.

Parameters:
base - destination directory for generated class(es).

getExtension

public boolean getExtension()
Gets the "extension" flag.

Returns:
true if extension mode is on, false otherwise.

setExtension

public void setExtension(boolean extension)
Sets the "extension" flag.

Parameters:
extension - true to set extension mode on, false otherwise.

getKeep

public boolean getKeep()
Gets the "keep" flag.

Returns:
Whether to keep generated sources.

setKeep

public void setKeep(boolean keep)
Sets the "keep" flag.

Parameters:
keep - keep generated sources.

getFork

public boolean getFork()
Gets the "fork" flag.

Returns:
true if execution should be done in forked JVM, false otherwise.

setFork

public void setFork(boolean fork)
Sets the "fork" flag.

Parameters:
fork - true to run execution in a forked JVM.

getSourcedestdir

public File getSourcedestdir()
Gets the directory to place generated source java files.

Returns:
destination directory for generated source(s).

setSourcedestdir

public void setSourcedestdir(File sourceBase)
Sets the directory to place generated source java files.

Parameters:
sourceBase - destination directory for generated source(s).

setEncoding

public void setEncoding(String encoding)
Sets the encoding for generated source java files.

Parameters:
encoding - encoding to use in generated sources.

getEncoding

public String getEncoding()
Gets the encoding for generated source java files.

Returns:
encoding to use in generated sources.

getVerbose

public boolean getVerbose()
Gets the "verbose" flag.

Returns:
true if messages about what the compiler is doing should be printed out.

setVerbose

public void setVerbose(boolean verbose)
Sets the "verbose" flag.

Parameters:
verbose - whether to output messages about what the compiler is doing.

getDebug

public boolean getDebug()
Gets the debug flag.

Returns:
true if all debugging info should be generated.

setDebug

public void setDebug(boolean debug)
Sets the debug flag.

Parameters:
debug - generate all debugging info.

createJavacarg

public Commandline.Argument createJavacarg()
Adds Javac argument.

Returns:
Javac argument created.
Since:
2.2.9

getJavacargs

public Commandline getJavacargs()

setXendorsed

public void setXendorsed(boolean xendorsed)

isXendorsed

public boolean isXendorsed()

isXnocompile

public boolean isXnocompile()

setXnocompile

public void setXnocompile(boolean xnocompile)

setFailonerror

public void setFailonerror(boolean value)
Mostly for our SQE teams and not to be advertised.

Parameters:
value - a boolean value

isFailonerror

public boolean isFailonerror()
Returns:
true if the task should fail on error.

setIncludeantruntime

public void setIncludeantruntime(boolean include)
Include ant's own classpath in this task's classpath?

Parameters:
include - a boolean value.

getIncludeantruntime

public boolean getIncludeantruntime()
Gets whether or not the ant classpath is to be included in the task's classpath.

Returns:
true if Ant classpath should be included in the task's classpath.

setIncludejavaruntime

public void setIncludejavaruntime(boolean include)
Sets whether or not to include the java runtime libraries to this task's classpath.

Parameters:
include - a boolean value.

getIncludejavaruntime

public boolean getIncludejavaruntime()
Gets whether or not the java runtime should be included in this task's classpath.

Returns:
true if java runtime classpath should be included in the task's classpath.

createJvmarg

public Commandline.Argument createJvmarg()
Adds a JVM argument.

Returns:
JVM argument created

execute

protected final void execute(String tool,
                             String toolClass)
                      throws BuildException
Let the task do it's work.

Parameters:
tool - string to use in logged messages
toolClass - class name to invoke
Throws:
BuildException - if invocation fails


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.