org.jomc.cli.commands
Class AbstractModletCommand

Package class diagram package AbstractModletCommand
java.lang.Object
  extended by org.jomc.cli.commands.AbstractCommand
      extended by org.jomc.cli.commands.AbstractModletCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
AbstractModelCommand, MergeModletsCommand

@Generated(value="org.jomc.tools.SourceFileProcessor 1.2.3",
           comments="See http://jomc.sourceforge.net/jomc/1.2/jomc-tools-1.2.3")
public abstract class AbstractModletCommand
extends AbstractCommand

JOMC CLI modlet based command implementation.

Identifier:
JOMC CLI Modlet Command
Name:
JOMC CLI Modlet Command
Specifications:
JOMC CLI Command @ 1.0
Abstract:
Yes
Final:
No
Stateless:
No

Version:
1.2.7
Author:
Christian Schulte 1.0

Nested Class Summary
 class AbstractModletCommand.CommandLineClassLoader
          Class loader backed by a command line.
 
Nested classes/interfaces inherited from interface org.jomc.cli.Command
Command.Listener
 
Field Summary
 
Fields inherited from interface org.jomc.cli.Command
STATUS_FAILURE, STATUS_SUCCESS
 
Constructor Summary
AbstractModletCommand()
          Creates a new AbstractModletCommand instance.
 
Method Summary
protected  ModelContext createModelContext(CommandLine commandLine, ClassLoader classLoader)
          Creates a new ModelContext for a given CommandLine and ClassLoader.
protected  Transformer createTransformer(Source source)
          Creates a new Transformer from a given Source.
protected  Set<File> getDocumentFiles(CommandLine commandLine)
          Gets the document files specified by a given command line.
protected  String getModel(CommandLine commandLine)
          Gets the identifier of the model to process.
 Options getOptions()
          Gets the options of the command.
protected  void log(ModelValidationReport validationReport, javax.xml.bind.Marshaller marshaller)
          Logs a validation report.
 
Methods inherited from class org.jomc.cli.commands.AbstractCommand
execute, executeCommand, getAbbreviatedName, getDefaultLogLevel, getExceptionMessage, getListeners, getLogLevel, getLongDescription, getName, getShortDescription, isLoggable, log, postExecuteCommand, preExecuteCommand, setDefaultLogLevel, setLogLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractModletCommand

@Generated(value="org.jomc.tools.SourceFileProcessor 1.2.3",
           comments="See http://jomc.sourceforge.net/jomc/1.2/jomc-tools-1.2.3")
public AbstractModletCommand()
Creates a new AbstractModletCommand instance.

Method Detail

createTransformer

protected Transformer createTransformer(Source source)
                                 throws CommandExecutionException
Creates a new Transformer from a given Source.

Parameters:
source - The source to initialize the transformer with.
Returns:
A Transformer backed by source.
Throws:
NullPointerException - if source is null.
CommandExecutionException - if creating a transformer fails.

createModelContext

protected ModelContext createModelContext(CommandLine commandLine,
                                          ClassLoader classLoader)
                                   throws CommandExecutionException
Creates a new ModelContext for a given CommandLine and ClassLoader.

Parameters:
commandLine - The CommandLine to create a new ModelContext with.
classLoader - The ClassLoader to create a new ModelContext with.
Returns:
A new ModelContext for classLoader setup using commandLine.
Throws:
NullPointerException - if commandLine is null.
CommandExecutionException - if creating an new ModelContext fails.

getModel

protected String getModel(CommandLine commandLine)
Gets the identifier of the model to process.

Parameters:
commandLine - The command line to get the identifier of the model to process from.
Returns:
The identifier of the model to process.
Throws:
NullPointerException - if commandLine is null.

log

protected void log(ModelValidationReport validationReport,
                   javax.xml.bind.Marshaller marshaller)
            throws CommandExecutionException
Logs a validation report.

Parameters:
validationReport - The report to log.
marshaller - The marshaller to use for logging the report.
Throws:
CommandExecutionException - if logging a report detail element fails.

getDocumentFiles

protected Set<File> getDocumentFiles(CommandLine commandLine)
                              throws CommandExecutionException
Gets the document files specified by a given command line.

Parameters:
commandLine - The command line specifying the document files to get.
Returns:
The document files specified by commandLine.
Throws:
CommandExecutionException - if getting the document files fails.

getOptions

@Generated(value="org.jomc.tools.SourceFileProcessor 1.2.3",
           comments="See http://jomc.sourceforge.net/jomc/1.2/jomc-tools-1.2.3")
public Options getOptions()
Gets the options of the command.

Options:

Specification Implementation
JOMC CLI Command Option (org.apache.commons.cli.Option) @ 1.2 JOMC CLI Classpath Option
JOMC CLI Command Option (org.apache.commons.cli.Option) @ 1.2 JOMC CLI Documents Option
JOMC CLI Command Option (org.apache.commons.cli.Option) @ 1.2 JOMC CLI ModelContextFactory Class Name Option
JOMC CLI Command Option (org.apache.commons.cli.Option) @ 1.2 JOMC CLI Model Option
JOMC CLI Command Option (org.apache.commons.cli.Option) @ 1.2 JOMC CLI Modlet Location Option
JOMC CLI Command Option (org.apache.commons.cli.Option) @ 1.2 JOMC CLI Modlet Schema System Id Option
JOMC CLI Command Option (org.apache.commons.cli.Option) @ 1.2 JOMC CLI No Modlet Resource Validation Option
JOMC CLI Command Option (org.apache.commons.cli.Option) @ 1.2 JOMC CLI Platform Provider Location Option
JOMC CLI Command Option (org.apache.commons.cli.Option) @ 1.2 JOMC CLI Provider Location Option

Specified by:
getOptions in interface Command
Overrides:
getOptions in class AbstractCommand
Returns:
The options of the command.


Copyright © 2005-2012 The JOMC Project. All Rights Reserved.Get JOMC at SourceForge.net. Fast, secure and Free Open Source software downloads
Please note that this documentation is maintained by non-native english speaking authors. As such, you may encounter phrases or wordings which seem imprecise or may even have a totally different meaning to native english speaking readers than what the individual author was trying to express. If you are a native english speaking reader and find any such phrases or wordings we kindly ask you to send an email to the corresponding author and help us improve this documentation in order to avoid misunderstandings. You will find the authors' email addresses at the top of each class. Please accept our apologies for any inconvenience caused.