com.sun.tools.ws.ant
Class WsTask2

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.tools.ant.taskdefs.MatchingTask
              extended by com.sun.tools.ws.ant.WsTask2
All Implemented Interfaces:
java.lang.Cloneable, org.apache.tools.ant.types.selectors.SelectorContainer
Direct Known Subclasses:
WsGen2, WsImport2

abstract class WsTask2
extends org.apache.tools.ant.taskdefs.MatchingTask

Base class for WS Tools Ant Task implementations.


Field Summary
 
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
WsTask2()
           
 
Method Summary
 org.apache.tools.ant.types.Commandline.Argument createJavacarg()
          Adds Javac argument.
 org.apache.tools.ant.types.Commandline.Argument createJvmarg()
          Adds a JVM argument.
protected  void execute(java.lang.String tool, java.lang.String toolClass)
          Let the task do it's work.
 boolean getDebug()
          Gets the debug flag.
 java.io.File getDestdir()
          Gets the base directory to output generated class.
 java.lang.String getEncoding()
          Gets the encoding for generated source java files.
 boolean getExtension()
          Gets the "extension" flag.
 boolean getFork()
          Gets the "fork" 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.
 org.apache.tools.ant.types.Commandline getJavacargs()
           
 boolean getKeep()
          Gets the "keep" flag.
 java.io.File getSourcedestdir()
          Gets the directory to place generated source java files.
 boolean getVerbose()
          Gets the "verbose" flag.
 boolean isFailonerror()
           
 boolean isXendorsed()
           
 boolean isXnocompile()
           
protected abstract  boolean runInVm(java.lang.String[] arguments, java.io.OutputStream out)
          Used to call the tool directly using API.
 void setDebug(boolean debug)
          Sets the debug flag.
 void setDestdir(java.io.File base)
          Sets the base directory to output generated class.
 void setEncoding(java.lang.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 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 setKeep(boolean keep)
          Sets the "keep" flag.
 void setSourcedestdir(java.io.File sourceBase)
          Sets the directory to place generated source java files.
protected  org.apache.tools.ant.types.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 org.apache.tools.ant.taskdefs.MatchingTask
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, execute, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WsTask2

WsTask2()
Method Detail

getDestdir

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

Returns:
destination directory for generated class(es).

setDestdir

public void setDestdir(java.io.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 java.io.File getSourcedestdir()
Gets the directory to place generated source java files.

Returns:
destination directory for generated source(s).

setSourcedestdir

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

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

setEncoding

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

Parameters:
encoding - encoding to use in generated sources.

getEncoding

public java.lang.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 org.apache.tools.ant.types.Commandline.Argument createJavacarg()
Adds Javac argument.

Returns:
Javac argument created.
Since:
2.2.9

getJavacargs

public org.apache.tools.ant.types.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 org.apache.tools.ant.types.Commandline.Argument createJvmarg()
Adds a JVM argument.

Returns:
JVM argument created

execute

protected final void execute(java.lang.String tool,
                             java.lang.String toolClass)
                      throws org.apache.tools.ant.BuildException
Let the task do it's work.

Parameters:
tool - string to use in logged messages
toolClass - class name to invoke
Throws:
org.apache.tools.ant.BuildException - if invocation fails

setupCommand

protected org.apache.tools.ant.types.CommandlineJava setupCommand()
Set up command line to invoke.

Returns:
ready to run command line

runInVm

protected abstract boolean runInVm(java.lang.String[] arguments,
                                   java.io.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


Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.