public abstract class AbstractJomcToolCommand extends AbstractModelCommand
JomcTool
based command implementation.AbstractModletCommand.CommandLineClassLoader
Command.Listener
STATUS_FAILURE, STATUS_SUCCESS
Constructor and Description |
---|
AbstractJomcToolCommand()
Creates a new
AbstractJomcToolCommand instance. |
Modifier and Type | Method and Description |
---|---|
protected <T extends JomcTool> |
createJomcTool(String className,
Class<T> type,
CommandLine commandLine)
Creates a new
JomcTool object for a given class name and type. |
protected <T> T |
createObject(String className,
Class<T> type)
Creates a new object for a given class name and type.
|
protected org.jomc.model.Implementation |
getImplementation(CommandLine commandLine,
Model model)
Gets the implementation to process from a given model.
|
protected Locale |
getLocale(CommandLine commandLine)
Gets a locale from a command line.
|
protected org.jomc.model.Module |
getModule(CommandLine commandLine,
Model model)
Gets the module to process from a given model.
|
Options |
getOptions()
Gets the options of the command.
|
protected org.jomc.model.Specification |
getSpecification(CommandLine commandLine,
Model model)
Gets the specification to process from a given model.
|
protected boolean |
isModulesProcessingRequested(CommandLine commandLine)
Gets a flag indicating that all modules are requested to be processed.
|
createModelContext, getModel
createTransformer, getDocumentFiles, getModel, log
execute, executeCommand, getDefaultLogLevel, getExecutorService, getListeners, getLogLevel, isLoggable, log, postExecuteCommand, preExecuteCommand, setDefaultLogLevel, setLogLevel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAbbreviatedName, getLongDescription, getName, getShortDescription
public AbstractJomcToolCommand()
AbstractJomcToolCommand
instance.public Options getOptions()
Command
getOptions
in interface Command
getOptions
in class AbstractModelCommand
protected <T> T createObject(String className, Class<T> type) throws CommandExecutionException
T
- The type of the object to create.className
- The name of the class to create an object of.type
- The class of the type of object to create.className
.NullPointerException
- if className
or type
is null
.CommandExecutionException
- if creating a new object fails.protected <T extends JomcTool> T createJomcTool(String className, Class<T> type, CommandLine commandLine) throws CommandExecutionException
JomcTool
object for a given class name and type.T
- The type of the object to create.commandLine
- The CommandLine
to configure the new JomcTool
object with.className
- The name of the class to create an object of.type
- The class of the type of object to create.className
configured using commandLine
.NullPointerException
- if commandLine
, className
or type
is null
.CommandExecutionException
- if creating a new object fails.createObject(java.lang.String, java.lang.Class)
protected final org.jomc.model.Specification getSpecification(CommandLine commandLine, Model model)
commandLine
- The command line specifying the specification to process.model
- The model to get the specification to process from.null
.NullPointerException
- if commandLine
or model
is null
.protected final org.jomc.model.Implementation getImplementation(CommandLine commandLine, Model model)
commandLine
- The command line specifying the implementation to process.model
- The model to get the implementation to process from.null
.NullPointerException
- if commandLine
or model
is null
.protected final org.jomc.model.Module getModule(CommandLine commandLine, Model model)
commandLine
- The command line specifying the implementation to process.model
- The model to get the module to process from.null
.NullPointerException
- if model
is null
.protected final boolean isModulesProcessingRequested(CommandLine commandLine)
commandLine
- The command line to process.true
, if processing of all modules is requested; false
, else.NullPointerException
- if commandLine
is null
.getSpecification(org.apache.commons.cli.CommandLine, org.jomc.modlet.Model)
,
getImplementation(org.apache.commons.cli.CommandLine, org.jomc.modlet.Model)
,
getModule(org.apache.commons.cli.CommandLine, org.jomc.modlet.Model)
protected final Locale getLocale(CommandLine commandLine)
commandLine
- The command line to get a locale from.commandLine
or null
, if commandLine
does not hold options
specifying a locale.Copyright © 2005–2016 The JOMC Project. All rights reserved.