org.apache.avalon.excalibur.cli
Class CLOptionDescriptor

java.lang.Object
  |
  +--org.apache.avalon.excalibur.cli.CLOptionDescriptor

public class CLOptionDescriptor
extends java.lang.Object

Basic class describing an type of option.

Author:
Peter Donald

Field Summary
static int ARGUMENT_DISALLOWED
           
static int ARGUMENT_OPTIONAL
           
static int ARGUMENT_REQUIRED
           
static int ARGUMENTS_REQUIRED_2
           
protected  java.lang.String m_description
           
protected  int m_flags
           
protected  int m_id
           
protected  int[] m_incompatable
           
protected  java.lang.String m_name
           
 
Constructor Summary
CLOptionDescriptor(java.lang.String name, int flags, int id, java.lang.String description)
          Constructor.
CLOptionDescriptor(java.lang.String name, int flags, int id, java.lang.String description, int[] incompatable)
          Constructor.
 
Method Summary
 java.lang.String getDescription()
          Retrieve textual description.
 int getFlags()
          Retrieve flags about option.
 int getId()
          Retrieve the id for option.
protected  int[] getIncompatble()
           
 java.lang.String getName()
          Retrieve name of option which is also text for long option.
 java.lang.String toString()
          Convert to String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ARGUMENT_REQUIRED

public static final int ARGUMENT_REQUIRED

ARGUMENT_OPTIONAL

public static final int ARGUMENT_OPTIONAL

ARGUMENT_DISALLOWED

public static final int ARGUMENT_DISALLOWED

ARGUMENTS_REQUIRED_2

public static final int ARGUMENTS_REQUIRED_2

m_id

protected final int m_id

m_flags

protected final int m_flags

m_name

protected final java.lang.String m_name

m_description

protected final java.lang.String m_description

m_incompatable

protected final int[] m_incompatable
Constructor Detail

CLOptionDescriptor

public CLOptionDescriptor(java.lang.String name,
                          int flags,
                          int id,
                          java.lang.String description)
Constructor.
Parameters:
name - the name/long option
flags - the flags
id - the id/character option
description - description of option usage

CLOptionDescriptor

public CLOptionDescriptor(java.lang.String name,
                          int flags,
                          int id,
                          java.lang.String description,
                          int[] incompatable)
Constructor.
Parameters:
name - the name/long option
flags - the flags
id - the id/character option
description - description of option usage
Method Detail

getIncompatble

protected int[] getIncompatble()

getDescription

public final java.lang.String getDescription()
Retrieve textual description.
Returns:
the description

getFlags

public final int getFlags()
Retrieve flags about option. Flags include details such as whether it allows parameters etc.
Returns:
the flags

getId

public final int getId()
Retrieve the id for option. The id is also the character if using single character options.
Returns:
the id

getName

public final java.lang.String getName()
Retrieve name of option which is also text for long option.
Returns:
name/long option

toString

public java.lang.String toString()
Convert to String.
Overrides:
toString in class java.lang.Object
Returns:
the converted value to string.


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.