Package org.jibx.schema.codegen
Class CodeGenCommandLine
- java.lang.Object
-
- org.jibx.custom.CustomizationCommandLineBase
-
- org.jibx.schema.codegen.CodeGenCommandLine
-
public class CodeGenCommandLine extends CustomizationCommandLineBase
Command line processing specifically for theCodeGenclass.- Author:
- Dennis M. Sosnoski
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jibx.custom.CustomizationCommandLineBase
CustomizationCommandLineBase.ArgList
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]EXTRA_USAGE_LINESOrdered array of extra usage lines.private java.lang.Stringm_bindingNameName used for root binding.private SchemasetCustomm_customRootCustomizations model root.private java.lang.Stringm_defaultPackageDefault package for all schemas.private java.io.Filem_differenceFileFile for checking differences in generated class structure (nullif none).private java.util.Listm_includePathsList of existing bindings to be included and used for matching schema definitions.private java.io.Filem_modelFileFile for dumping the generated class structure (nullif none).private java.lang.Stringm_nonamespacePackageDefault package for no-namespace schemas.private java.lang.Stringm_rootPathSchema root path.private java.io.Filem_schemaDirRoot directory for schemas (nullif not a file system root).private java.net.URLm_schemaRootRoot URL for schemas.private java.lang.Stringm_usingNamespaceNamespace to be used for no-namespace schemas generated directly.private static Loggers_loggerLogger for class.-
Fields inherited from class org.jibx.custom.CustomizationCommandLineBase
STRING_PARAMETER_ARRAY, STRING_UNMARSHALLER_PARAMETER_ARRAY
-
-
Constructor Summary
Constructors Constructor Description CodeGenCommandLine()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.MapapplyOverrides(java.util.Map overmap)Apply map of override values to customizations read from file or created as default.protected booleancheckParameter(CustomizationCommandLineBase.ArgList alist)Check extension parameter.protected voidfinishParameters(CustomizationCommandLineBase.ArgList alist)Finish processing of command line parameters.java.lang.StringgetBindingName()Get binding name.SchemasetCustomgetCustomRoot()Get customizations model root.java.io.FilegetDifferenceFile()Get file to be used for finding differences in generated data model.java.util.ListgetIncludePaths()Get the list of paths for bindings to be used for matching schema definitions.java.io.FilegetModelFile()Get file to be used for dumping generated data model.java.lang.StringgetNonamespacePackage()Get default package for no-namespace schemas.java.io.FilegetSchemaDir()Get root directory for schemas.java.net.URLgetSchemaRoot()Get root URL for schemas.java.lang.StringgetUsingNamespace()Get namespace to be used when no schemas with namespaces are being generated.protected booleanloadCustomizations(java.lang.String path)Load the customizations file.voidprintUsage()Print usage information.-
Methods inherited from class org.jibx.custom.CustomizationCommandLineBase
getExtraArgs, getGeneratePath, getUsageLines, isVerbose, mergeUsageLines, processArgs, putKeyValue, verboseDetails
-
-
-
-
Field Detail
-
s_logger
private static final Logger s_logger
Logger for class.
-
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 path.
-
m_bindingName
private java.lang.String m_bindingName
Name used for root binding.
-
m_usingNamespace
private java.lang.String m_usingNamespace
Namespace to be used for no-namespace schemas generated directly.
-
m_schemaRoot
private java.net.URL m_schemaRoot
Root URL for schemas.
-
m_schemaDir
private java.io.File m_schemaDir
Root directory for schemas (nullif not a file system root).
-
m_modelFile
private java.io.File m_modelFile
File for dumping the generated class structure (nullif none).
-
m_differenceFile
private java.io.File m_differenceFile
File for checking differences in generated class structure (nullif none).
-
m_customRoot
private SchemasetCustom m_customRoot
Customizations model root.
-
m_includePaths
private java.util.List m_includePaths
List of existing bindings to be included and used for matching schema definitions.
-
-
Method Detail
-
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 (
nullif root is not a directory)
-
getBindingName
public java.lang.String getBindingName()
Get binding name.- Returns:
- name (
nullif not set)
-
getUsingNamespace
public java.lang.String getUsingNamespace()
Get namespace to be used when no schemas with namespaces are being generated.- Returns:
- namespace URI (
nullif unspecified)
-
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 (
nullif not set)
-
getModelFile
public java.io.File getModelFile()
Get file to be used for dumping generated data model.- Returns:
- dump file (
nullif none)
-
getDifferenceFile
public java.io.File getDifferenceFile()
Get file to be used for finding differences in generated data model.- Returns:
- difference file (
nullif none)
-
getIncludePaths
public java.util.List getIncludePaths()
Get the list of paths for bindings to be used for matching schema definitions.- Returns:
- paths (empty if no paths specified)
-
checkParameter
protected boolean checkParameter(CustomizationCommandLineBase.ArgList alist)
Description copied from class:CustomizationCommandLineBaseCheck extension parameter. This method may be overridden by subclasses to process parameters beyond those known to this base class.- Overrides:
checkParameterin classCustomizationCommandLineBase- Parameters:
alist- argument list- Returns:
trueif parameter processed,falseif unknown
-
finishParameters
protected void finishParameters(CustomizationCommandLineBase.ArgList alist)
Finish processing of command line parameters. This just sets up the schema directory.- Overrides:
finishParametersin classCustomizationCommandLineBase- Parameters:
alist-
-
loadCustomizations
protected boolean loadCustomizations(java.lang.String path) throws JiBXException, java.io.IOExceptionLoad the customizations file. This method must load the specified customizations file, or create a default customizations instance, of the appropriate type.- Specified by:
loadCustomizationsin classCustomizationCommandLineBase- Parameters:
path- customization file path- Returns:
trueif successful,falseif an error- Throws:
JiBXExceptionjava.io.IOException
-
applyOverrides
protected java.util.Map applyOverrides(java.util.Map overmap)
Description copied from class:CustomizationCommandLineBaseApply map of override values to customizations read from file or created as default.- Specified by:
applyOverridesin classCustomizationCommandLineBase- Parameters:
overmap- override key-value map- Returns:
- map for key/values not recognized
-
printUsage
public void printUsage()
Description copied from class:CustomizationCommandLineBasePrint usage information.- Specified by:
printUsagein classCustomizationCommandLineBase
-
-