org.jomc.cli
Class Jomc

Package class diagram package Jomc
java.lang.Object
  extended by org.jomc.cli.Jomc

@Generated(value="org.jomc.tools.JavaSources",
           comments="See http://jomc.sourceforge.net/jomc/1.0-alpha-11/jomc-tools")
public class Jomc
extends Object

JOMC command line interface.

Properties

Dependencies

Messages

Version:
$Id: Jomc.java 1102 2009-12-07 03:01:58Z schulte2005 $
Author:
Christian Schulte 1.0

Constructor Summary
Jomc()
          Creates a new Jomc instance.
 
Method Summary
 org.apache.commons.cli.Option getDebugOption()
           
static Level getDefaultLogLevel()
          Gets the default log level events are logged at.
 org.apache.commons.cli.Option getFailOnWarningsOption()
           
 Level getLogLevel()
          Gets the log level of the instance.
 PrintWriter getPrintWriter()
          Gets the print writer of the instance.
 org.apache.commons.cli.Option getVerboseOption()
           
 boolean isLoggable(Level level)
          Checks if a message at a given level is provided to the listeners of the instance.
 int jomc(String[] args)
          Processes the given arguments and executes the corresponding command.
protected  void log(Level level, String message, Throwable throwable)
          Logs to the print writer of the instance.
static void main(String[] args)
          Main entry point.
static int run(String[] args)
          Main entry point without exiting the VM.
static void setDefaultLogLevel(Level value)
          Sets the default log level events are logged at.
 void setLogLevel(Level value)
          Sets the log level of the instance.
 void setPrintWriter(PrintWriter value)
          Sets the print writer of the instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Jomc

@Generated(value="org.jomc.tools.JavaSources",
           comments="See http://jomc.sourceforge.net/jomc/1.0-alpha-11/jomc-tools")
public Jomc()
Creates a new Jomc instance.

Method Detail

getPrintWriter

public PrintWriter getPrintWriter()
Gets the print writer of the instance.

Returns:
The print writer of the instance.

setPrintWriter

public void setPrintWriter(PrintWriter value)
Sets the print writer of the instance.

Parameters:
value - The new print writer of the instance or null.

getDefaultLogLevel

public static Level getDefaultLogLevel()
Gets the default log level events are logged at.

The default log level is controlled by system property org.jomc.cli.Jomc.defaultLogLevel holding the log level to log events at by default. If that property is not set, the WARNING default is returned.

Returns:
The log level events are logged at by default.
See Also:
getLogLevel(), Level.parse(java.lang.String)

setDefaultLogLevel

public static void setDefaultLogLevel(Level value)
Sets the default log level events are logged at.

Parameters:
value - The new default level events are logged at or null.
See Also:
getDefaultLogLevel()

getLogLevel

public Level getLogLevel()
Gets the log level of the instance.

Returns:
The log level of the instance.
See Also:
getDefaultLogLevel(), setLogLevel(java.util.logging.Level), isLoggable(java.util.logging.Level)

setLogLevel

public void setLogLevel(Level value)
Sets the log level of the instance.

Parameters:
value - The new log level of the instance or null.
See Also:
getLogLevel(), isLoggable(java.util.logging.Level)

isLoggable

public boolean isLoggable(Level level)
Checks if a message at a given level is provided to the listeners of the instance.

Parameters:
level - The level to test.
Returns:
true if messages at level are provided to the listeners of the instance; false if messages at level are not provided to the listeners of the instance.
Throws:
NullPointerException - if level is null.
See Also:
getLogLevel(), setLogLevel(java.util.logging.Level)

getVerboseOption

public org.apache.commons.cli.Option getVerboseOption()

getDebugOption

public org.apache.commons.cli.Option getDebugOption()

getFailOnWarningsOption

public org.apache.commons.cli.Option getFailOnWarningsOption()

jomc

public int jomc(String[] args)
Processes the given arguments and executes the corresponding command.

Parameters:
args - Arguments to process.
Returns:
Status code.
See Also:
Command.STATUS_SUCCESS, Command.STATUS_FAILURE

main

public static void main(String[] args)
Main entry point.

Parameters:
args - The application arguments.

run

public static int run(String[] args)
Main entry point without exiting the VM.

Parameters:
args - The application arguments.
Returns:
Status code.
See Also:
Command.STATUS_SUCCESS, Command.STATUS_FAILURE

log

protected void log(Level level,
                   String message,
                   Throwable throwable)
Logs to the print writer of the instance.

Parameters:
level - The level of the event.
message - The message of the event or null.
throwable - The throwable of the event null.
Throws:
NullPointerException - if level is null.


Copyright © 2005-2009 The JOMC Project. All Rights Reserved.