com.sun.tools.xjc
Class Options

java.lang.Object
  extended by com.sun.tools.xjc.Options
Direct Known Subclasses:
Driver.OptionsEx

public class Options
extends java.lang.Object

Global options.

This class stores invocation configuration for XJC. The configuration in this class shoule be abstract enough so that it could be parsed from both command-line or Ant.


Field Summary
 java.util.List<Plugin> activePlugins
          Plugins that are enabled in this compilation.
static java.util.List<Plugin> allPlugins
          All discovered Plugins.
 ClassNameAllocator classNameAllocator
          This allocator has the final say on deciding the class name.
 java.util.List<java.net.URL> classpaths
           
 int compatibilityMode
          this switch determines how carefully the compiler will follow the compatibility rules in the spec.
 boolean debugMode
          If "-debug" is specified.
 java.lang.String defaultPackage
          The -p option that should control the default Java package that will contain the generated code.
 java.lang.String defaultPackage2
          Similar to the -p option, but this one works with a lower priority, and customizations overrides this.
 org.xml.sax.EntityResolver entityResolver
          Actually stores CatalogResolver, but the field type is made to EntityResolver so that XJC can be used even if resolver.jar is not available in the classpath.
static int EXTENSION
          loosely follow the compatibility rules and allow the use of vendor binding extensions
 boolean packageLevelAnnotations
          This switch controls whether or not xjc will generate package level annotations
 java.util.Set<java.lang.String> pluginURIs
          Set of URIs that plug-ins recognize as extension bindings.
 boolean quiet
          If the "-quiet" option is specified.
 boolean readOnly
          If the -readOnly option is specified
static int STRICT
          strictly follow the compatibility rules and reject schemas that contain features from App.
 boolean strictCheck
          Check the source schemas with extra scrutiny.
 java.io.File targetDir
          Target direcoty when producing files.
 boolean verbose
          If the "-verbose" option is specified.
 
Constructor Summary
Options()
           
 
Method Summary
 void addBindFile(org.xml.sax.InputSource is)
          Adds a new input schema.
 void addCatalog(java.io.File catalogFile)
          Adds a new catalog file.
 void addGrammar(java.io.File source)
           
 void addGrammar(org.xml.sax.InputSource is)
          Adds a new input schema.
 void addGrammarRecursive(java.io.File dir)
          Recursively scan directories and add all XSD files in it.
 org.xml.sax.InputSource[] getBindFiles()
          Input external binding files.
static java.lang.String getBuildID()
           
 org.xml.sax.InputSource[] getGrammars()
          Input schema files.
 Language getSchemaLanguage()
           
 java.net.URLClassLoader getUserClassLoader(java.lang.ClassLoader parent)
          Gets a classLoader that can load classes specified via the -classpath option.
 Language guessSchemaLanguage()
          Guesses the schema language.
protected  int parseArgument(java.lang.String[] args, int i)
          Parses an option args[i] and return the number of tokens consumed.
 void parseArguments(java.lang.String[] args)
          Parses arguments and fill fields of this object.
 void setSchemaLanguage(Language _schemaLanguage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugMode

public boolean debugMode
If "-debug" is specified.


verbose

public boolean verbose
If the "-verbose" option is specified.


quiet

public boolean quiet
If the "-quiet" option is specified.


readOnly

public boolean readOnly
If the -readOnly option is specified


strictCheck

public boolean strictCheck
Check the source schemas with extra scrutiny. The exact meaning depends on the schema language.


STRICT

public static final int STRICT
strictly follow the compatibility rules and reject schemas that contain features from App. E.2, use vendor binding extensions

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 java.io.File targetDir
Target direcoty when producing files.


entityResolver

public org.xml.sax.EntityResolver entityResolver
Actually stores CatalogResolver, but the field type is made to EntityResolver so that XJC can be used even if resolver.jar is not available in the classpath.


defaultPackage

public java.lang.String defaultPackage
The -p option that should control the default Java package that will contain the generated code. Null if unspecified.


defaultPackage2

public java.lang.String defaultPackage2
Similar to the -p option, but this one works with a lower priority, and customizations overrides this. Used by JAX-RPC.


activePlugins

public final java.util.List<Plugin> activePlugins
Plugins that are enabled in this compilation.


allPlugins

public static final java.util.List<Plugin> allPlugins
All discovered Plugins.


pluginURIs

public final java.util.Set<java.lang.String> pluginURIs
Set of URIs that plug-ins recognize as extension bindings.


classNameAllocator

public ClassNameAllocator classNameAllocator
This allocator has the final say on deciding the class name.


packageLevelAnnotations

public boolean packageLevelAnnotations
This switch controls whether or not xjc will generate package level annotations


classpaths

public final java.util.List<java.net.URL> classpaths
Constructor Detail

Options

public Options()
Method Detail

getSchemaLanguage

public Language getSchemaLanguage()

setSchemaLanguage

public void setSchemaLanguage(Language _schemaLanguage)

getGrammars

public org.xml.sax.InputSource[] getGrammars()
Input schema files.


addGrammar

public void addGrammar(org.xml.sax.InputSource is)
Adds a new input schema.


addGrammar

public void addGrammar(java.io.File source)

addGrammarRecursive

public void addGrammarRecursive(java.io.File dir)
Recursively scan directories and add all XSD files in it.


getBindFiles

public org.xml.sax.InputSource[] getBindFiles()
Input external binding files.


addBindFile

public void addBindFile(org.xml.sax.InputSource is)
Adds a new input schema.


getUserClassLoader

public java.net.URLClassLoader getUserClassLoader(java.lang.ClassLoader parent)
Gets a classLoader that can load classes specified via the -classpath option.


parseArgument

protected int parseArgument(java.lang.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.

addCatalog

public void addCatalog(java.io.File catalogFile)
                throws java.io.IOException
Adds a new catalog file.

Throws:
java.io.IOException

parseArguments

public void parseArguments(java.lang.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

guessSchemaLanguage

public Language guessSchemaLanguage()
Guesses the schema language.


getBuildID

public static java.lang.String getBuildID()