org.jibx.schema.codegen
Class CodeGenCommandLine

java.lang.Object
  extended by org.jibx.custom.CustomizationCommandLineBase
      extended by org.jibx.schema.codegen.CodeGenCommandLine

public class CodeGenCommandLine
extends CustomizationCommandLineBase

Command line processing specifically for the CodeGen class.

Author:
Dennis M. Sosnoski

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jibx.custom.CustomizationCommandLineBase
CustomizationCommandLineBase.ArgList
 
Field Summary
private static java.lang.String[] EXTRA_USAGE_LINES
          Ordered array of extra usage lines.
private  SchemasetCustom m_customRoot
          Customizations model root.
private  java.lang.String m_defaultPackage
          Default package for all schemas.
private  java.io.File m_dumpFile
          File for dumping the generated class structure (null if none).
private  java.lang.String m_nonamespacePackage
          Default package for no-namespace schemas.
private  java.lang.String m_rootPath
          Schema root URL path.
private  java.io.File m_schemaDir
          Root directory for schemas (null if not a file system root).
private  java.net.URL m_schemaRoot
          Root URL for schemas.
 
Fields inherited from class org.jibx.custom.CustomizationCommandLineBase
STRING_PARAMETER_ARRAY, STRING_UNMARSHALLER_PARAMETER_ARRAY
 
Constructor Summary
CodeGenCommandLine()
          Constructor.
 
Method Summary
protected  java.util.Map applyOverrides(java.util.Map overmap)
          Apply map of override values to customizations read from file or created as default.
protected  boolean checkParameter(CustomizationCommandLineBase.ArgList alist)
          Check extension parameter.
protected  void finishParameters(CustomizationCommandLineBase.ArgList alist)
          Finish processing of command line parameters.
 SchemasetCustom getCustomRoot()
          Get customizations model root.
 java.lang.String getDefaultPackage()
          Get default package for all schemas.
 java.io.File getDumpFile()
          Get file to be used for dumping generated data model.
 java.lang.String getNonamespacePackage()
          Get default package for no-namespace schemas.
 java.lang.String getRootPath()
          Get root path for schemas.
 java.io.File getSchemaDir()
          Get root directory for schemas.
 java.net.URL getSchemaRoot()
          Get root URL for schemas.
protected  boolean loadCustomizations(java.lang.String path)
          Load the customizations file.
 void printUsage()
          Print usage information.
 
Methods inherited from class org.jibx.custom.CustomizationCommandLineBase
applyKeyValueMap, getExtraArgs, getGeneratePath, getUsageLines, isVerbose, mergeUsageLines, processArgs, putKeyValue, verboseDetails
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTRA_USAGE_LINES

private static final java.lang.String[] EXTRA_USAGE_LINES
Ordered array of extra usage lines.


m_nonamespacePackage

private java.lang.String m_nonamespacePackage
Default package for no-namespace schemas.


m_defaultPackage

private java.lang.String m_defaultPackage
Default package for all schemas.


m_rootPath

private java.lang.String m_rootPath
Schema root URL path.


m_schemaRoot

private java.net.URL m_schemaRoot
Root URL for schemas.


m_schemaDir

private java.io.File m_schemaDir
Root directory for schemas (null if not a file system root).


m_dumpFile

private java.io.File m_dumpFile
File for dumping the generated class structure (null if none).


m_customRoot

private SchemasetCustom m_customRoot
Customizations model root.

Constructor Detail

CodeGenCommandLine

public CodeGenCommandLine()
Constructor.

Method Detail

getRootPath

public java.lang.String getRootPath()
Get root path for schemas.

Returns:
root path from command line parameters, null if not specified

getSchemaRoot

public java.net.URL getSchemaRoot()
Get root URL for schemas.

Returns:
directory

getSchemaDir

public java.io.File getSchemaDir()
Get root directory for schemas.

Returns:
directory (null if root is not a directory)

getCustomRoot

public SchemasetCustom getCustomRoot()
Get customizations model root.

Returns:
customizations

getNonamespacePackage

public java.lang.String getNonamespacePackage()
Get default package for no-namespace schemas.

Returns:
package (null if not set)

getDefaultPackage

public java.lang.String getDefaultPackage()
Get default package for all schemas.

Returns:
package (null if not set)

getDumpFile

public java.io.File getDumpFile()
Get file to be used for dumping generated data model.

Returns:
dump file (null if none)

checkParameter

protected boolean checkParameter(CustomizationCommandLineBase.ArgList alist)
Description copied from class: CustomizationCommandLineBase
Check extension parameter. This method may be overridden by subclasses to process parameters beyond those known to this base class.

Overrides:
checkParameter in class CustomizationCommandLineBase
Parameters:
alist - argument list
Returns:
true if parameter processed, false if unknown

finishParameters

protected void finishParameters(CustomizationCommandLineBase.ArgList alist)
Finish processing of command line parameters. This just sets up the schema directory.

Overrides:
finishParameters in class CustomizationCommandLineBase
Parameters:
alist -

loadCustomizations

protected boolean loadCustomizations(java.lang.String path)
                              throws JiBXException,
                                     java.io.IOException
Load the customizations file. This method must load the specified customizations file, or create a default customizations instance, of the appropriate type.

Specified by:
loadCustomizations in class CustomizationCommandLineBase
Parameters:
path - customization file path
Returns:
true if successful, false if an error
Throws:
JiBXException
java.io.IOException

applyOverrides

protected java.util.Map applyOverrides(java.util.Map overmap)
Description copied from class: CustomizationCommandLineBase
Apply map of override values to customizations read from file or created as default.

Specified by:
applyOverrides in class CustomizationCommandLineBase
Parameters:
overmap - override key-value map
Returns:
map for key/values not recognized

printUsage

public void printUsage()
Description copied from class: CustomizationCommandLineBase
Print usage information.

Specified by:
printUsage in class CustomizationCommandLineBase


Project Web Site