net.sf.mmm.util.cli.api
Enum CliStyleHandling

java.lang.Object
  extended by java.lang.Enum<CliStyleHandling>
      extended by net.sf.mmm.util.cli.api.CliStyleHandling
All Implemented Interfaces:
Serializable, Comparable<CliStyleHandling>

public enum CliStyleHandling
extends Enum<CliStyleHandling>

This enum contains the available ways to handle a specific CLI-style.

Since:
2.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
See Also:
CliStyle.optionNameNotAcceptedByFilter(), CliStyle.optionSyntaxAssignment(), CliStyle.optionDuplicated(), CliStyle.modeUndefined()

Enum Constant Summary
DEBUG
          Log a debug message on occurrence.
EXCEPTION
          Cause an exception on occurrence.
OK
          Accept the according style as normal.
WARNING
          Log a warning on occurrence.
 
Method Summary
abstract  void handle(org.slf4j.Logger logger, RuntimeException exception)
          This method performs the handling of the anomaly represented by the given exception.
static CliStyleHandling valueOf(String name)
          Returns the enum constant of this type with the specified name.
static CliStyleHandling[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

OK

public static final CliStyleHandling OK
Accept the according style as normal.


DEBUG

public static final CliStyleHandling DEBUG
Log a debug message on occurrence.


WARNING

public static final CliStyleHandling WARNING
Log a warning on occurrence.


EXCEPTION

public static final CliStyleHandling EXCEPTION
Cause an exception on occurrence.

Method Detail

values

public static CliStyleHandling[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (CliStyleHandling c : CliStyleHandling.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static CliStyleHandling valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

handle

public abstract void handle(org.slf4j.Logger logger,
                            RuntimeException exception)
This method performs the handling of the anomaly represented by the given exception.
You should avoid creating the exception and call this method for the handling OK.

Parameters:
logger - is the Logger potentially used to log the exception (-message).
exception - informs about the anomaly.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.