getopt-0.3

jrowe.getopt
Class OptionException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--jrowe.getopt.OptionException

public class OptionException
extends RuntimeException

An Exception representing when there has been an invalid option detected in the command line arguments.

Version:
1.1 MAR 10 2000 Moved from package org.jrowe.getopt to jrowe.getopt.
Author:
Joshua T. Rowe
See Also:
Serialized Form

Field Summary
static int MALFORMED_ARGUMENT
          A constant representing an incorrectly formatted argument for an option.
static int MISSING_ARGUMENT
          A constant representing a missing argument for an option.
static int NO_ERROR
          A constant representing no error.
static int UNKNOWN_ERROR
          A constant representing an uknown error.
static int UNKNOWN_OPTION
          A constant representing an uknown option.
 
Constructor Summary
OptionException()
          Creates a new OptionException with the default properties.
OptionException(String s, int errorCode)
          Creates a new OptionException with the given properties.
 
Method Summary
 int getErrorCode()
          Returns the error code.
protected  void setErrorCode(int errorCode)
          Sets the error code.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_ERROR

public static final int NO_ERROR
A constant representing no error.

UNKNOWN_OPTION

public static final int UNKNOWN_OPTION
A constant representing an uknown option.

MISSING_ARGUMENT

public static final int MISSING_ARGUMENT
A constant representing a missing argument for an option.

MALFORMED_ARGUMENT

public static final int MALFORMED_ARGUMENT
A constant representing an incorrectly formatted argument for an option.

UNKNOWN_ERROR

public static final int UNKNOWN_ERROR
A constant representing an uknown error.
Constructor Detail

OptionException

public OptionException()
Creates a new OptionException with the default properties.

OptionException

public OptionException(String s,
                       int errorCode)
Creates a new OptionException with the given properties.
Method Detail

setErrorCode

protected void setErrorCode(int errorCode)
Sets the error code.
Parameters:
errorCode - the error code

getErrorCode

public int getErrorCode()
Returns the error code.
Returns:
the error code

getopt-0.3