com.sun.tools.ws.wscompile
Class Options

java.lang.Object
  extended by com.sun.tools.ws.wscompile.Options
Direct Known Subclasses:
WsgenOptions, WsimportOptions

public class Options
extends Object

Provide common jaxws tool options.


Nested Class Summary
static class Options.Target
           
static class Options.WeAreDone
          Used to signal that we've finished processing.
 
Field Summary
 String classpath
           
 int compatibilityMode
          this switch determines how carefully the compiler will follow the compatibility rules in the spec.
 boolean debug
           
 boolean debugMode
          -Xdebug - gives complete stack trace
 File destDir
          -d
static int EXTENSION
          loosely follow the compatibility rules and allow the use of vendor binding extensions
 boolean keep
          -keep
 boolean nocompile
          -Xnocompile
 boolean quiet
          - quite
 File sourceDir
          -s
static int STRICT
          strictly follow the compatibility rules specified in JAXWS spec
 Options.Target target
           
 File targetDir
          Target direcoty when producing files.
 boolean verbose
          -verbose
 
Constructor Summary
Options()
           
 
Method Summary
protected  void addFile(String arg)
          Adds a file from the argume
 void addGeneratedFile(File file)
          Remember info on generated source file generated so that it can be removed later, if appropriate.
 void deleteGeneratedFiles()
          Delete all the generated source files made during the execution of this environment (those that have been registered with the "addGeneratedFile" method).
static URL fileToURL(File file)
          Returns the directory or JAR file URL corresponding to the specified local file name.
 ClassLoader getClassLoader()
          Get a URLClassLoader from using the classpath
 Iterable<File> getGeneratedFiles()
          Return all the generated files and its types.
 boolean isExtensionMode()
           
 void parseArguments(String[] args)
          Parses arguments and fill fields of this object.
protected  int parseArguments(String[] args, int i)
          Parses an option args[i] and return the number of tokens consumed.
static URL[] pathToURLs(String path)
          Utility method for converting a search path string to an array of directory and JAR file URLs.
 void removeGeneratedFiles()
          Remove generated files
 String requireArgument(String optionName, String[] args, int i)
          Obtains an operand and reports an error if it's not there.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

verbose

public boolean verbose
-verbose


quiet

public boolean quiet
- quite


keep

public boolean keep
-keep


destDir

public File destDir
-d


sourceDir

public File sourceDir
-s


classpath

public String classpath

nocompile

public boolean nocompile
-Xnocompile


target

public Options.Target target

STRICT

public static final int STRICT
strictly follow the compatibility rules specified in JAXWS spec

See Also:
Constant Field Values

EXTENSION

public static final int EXTENSION
loosely follow the compatibility rules and allow the use of vendor binding extensions

See Also:
Constant Field Values

compatibilityMode

public int compatibilityMode
this switch determines how carefully the compiler will follow the compatibility rules in the spec. Either STRICT or EXTENSION.


targetDir

public File targetDir
Target direcoty when producing files.


debug

public boolean debug

debugMode

public boolean debugMode
-Xdebug - gives complete stack trace

Constructor Detail

Options

public Options()
Method Detail

isExtensionMode

public boolean isExtensionMode()

addGeneratedFile

public void addGeneratedFile(File file)
Remember info on generated source file generated so that it can be removed later, if appropriate.


removeGeneratedFiles

public void removeGeneratedFiles()
Remove generated files


getGeneratedFiles

public Iterable<File> getGeneratedFiles()
Return all the generated files and its types.


deleteGeneratedFiles

public void deleteGeneratedFiles()
Delete all the generated source files made during the execution of this environment (those that have been registered with the "addGeneratedFile" method).


parseArguments

public final void parseArguments(String[] args)
                          throws BadCommandLineException
Parses arguments and fill fields of this object.

Throws:
BadCommandLineException - thrown when there's a problem in the command-line arguments

addFile

protected void addFile(String arg)
                throws BadCommandLineException
Adds a file from the argume

Parameters:
arg - a file, could be a wsdl or xsd or a Class
Throws:
BadCommandLineException

parseArguments

protected int parseArguments(String[] args,
                             int i)
                      throws BadCommandLineException
Parses an option args[i] and return the number of tokens consumed.

Returns:
0 if the argument is not understood. Returning 0 will let the caller report an error.
Throws:
BadCommandLineException - If the callee wants to provide a custom message for an error.

requireArgument

public String requireArgument(String optionName,
                              String[] args,
                              int i)
                       throws BadCommandLineException
Obtains an operand and reports an error if it's not there.

Throws:
BadCommandLineException

getClassLoader

public ClassLoader getClassLoader()
Get a URLClassLoader from using the classpath


pathToURLs

public static URL[] pathToURLs(String path)
Utility method for converting a search path string to an array of directory and JAR file URLs.

Parameters:
path - the search path string
Returns:
the resulting array of directory and JAR file URLs

fileToURL

public static URL fileToURL(File file)
Returns the directory or JAR file URL corresponding to the specified local file name.

Parameters:
file - the File object
Returns:
the resulting directory or JAR file URL, or null if unknown