net.sf.mmm.util.cli.api
Class AbstractVersionedMain
java.lang.Object
net.sf.mmm.util.component.base.AbstractLoggableObject
net.sf.mmm.util.cli.api.AbstractMain
net.sf.mmm.util.cli.api.AbstractVersionedMain
- Direct Known Subclasses:
- ResourceBundleSynchronizer
@CliMode(id="version",
title="version",
usage="Print the version of this program.")
public abstract class AbstractVersionedMain
- extends AbstractMain
This is the abstract base class for a main-program
that
has a version.
- Since:
- 2.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
Method Summary |
protected String |
getVersion()
This method gets the Version of this program. |
protected int |
run(CliModeObject mode)
This method is called after the options are parsed and injected. |
Methods inherited from class net.sf.mmm.util.cli.api.AbstractMain |
getIocContainer, getOutputSettings, getParserBuilder, getStandardError, getStandardOutput, getStreamUtil, handleError, printHelp, run, setStandardError, setStandardOutput, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SNAPSHOT
private static final String SNAPSHOT
- The
version
if NOT available from Manifest
.
- See Also:
- Constant Field Values
version
@CliOption(name="--version",
aliases="-v",
usage="Print the program-version.",
mode="version",
required=true)
private boolean version
- The option to print the version.
AbstractVersionedMain
public AbstractVersionedMain()
getVersion
protected String getVersion()
- This method gets the Version of this program.
- Returns:
- the program-version.
run
protected int run(CliModeObject mode)
throws Exception
- This method is called after the options are parsed and injected. It has to
be implemented and should do the actual job.
- Specified by:
run
in class AbstractMain
- Parameters:
mode
- is the mode
of the invocation.
- Returns:
- the error-code or
AbstractMain.EXIT_CODE_OK
on success.
- Throws:
Exception
- in case of an unexpected error.
Copyright © 2001-2010 mmm-Team. All Rights Reserved.