FileDocCategorySizeDatePackage
CLOptionDescriptor.javaAPI DocApache Axis 1.44800Sat Apr 22 18:57:28 BST 2006org.apache.axis.utils

CLOptionDescriptor

public final class CLOptionDescriptor extends Object
Basic class describing an type of option. Typically, one creates a static array of CLOptionDescriptors, and passes it to {@link CLArgsParser#CLArgsParser(String[], CLOptionDescriptor[])}.
author
Peter Donald
since
4.0

Fields Summary
public static final int
ARGUMENT_REQUIRED
Flag to say that one argument is required
public static final int
ARGUMENT_OPTIONAL
Flag to say that the argument is optional
public static final int
ARGUMENT_DISALLOWED
Flag to say this option does not take arguments
public static final int
ARGUMENTS_REQUIRED_2
Flag to say this option requires 2 arguments
public static final int
DUPLICATES_ALLOWED
Flag to say this option may be repeated on the command line
private final int
m_id
private final int
m_flags
private final String
m_name
private final String
m_description
private final int[]
m_incompatible
Constructors Summary
public CLOptionDescriptor(String name, int flags, int id, String description)
Constructor.

param
name the name/long option
param
flags the flags
param
id the id/character option
param
description description of option usage


                              
        
                                 
                                 
                                  
    
        this( name, flags, id, description,
            ((flags & CLOptionDescriptor.DUPLICATES_ALLOWED) > 0)
                ? new int[] {}
                : new int[] { id } );
    
public CLOptionDescriptor(String name, int flags, int id, String description, int[] incompatable)
Constructor.

param
name the name/long option
param
flags the flags
param
id the id/character option
param
description description of option usage

        m_id = id;
        m_name = name;
        m_flags = flags;
        m_description = description;
        m_incompatible = incompatable;
    
Methods Summary
public final java.lang.StringgetDescription()
Retrieve textual description.

return
the description

        return m_description;
    
public final intgetFlags()
Retrieve flags about option. Flags include details such as whether it allows parameters etc.

return
the flags

        return m_flags;
    
public final intgetId()
Retrieve the id for option. The id is also the character if using single character options.

return
the id

        return m_id;
    
protected final int[]getIncompatble()

deprecated
Use the correctly spelled {@link #getIncompatible} instead.

        return getIncompatible();
    
protected final int[]getIncompatible()

        return m_incompatible;
    
public final java.lang.StringgetName()
Retrieve name of option which is also text for long option.

return
name/long option

        return m_name;
    
public final java.lang.StringtoString()
Convert to String.

return
the converted value to string.

        return
            new StringBuffer()
            .append("[OptionDescriptor ").append(m_name)
            .append(", ").append(m_id).append(", ").append(m_flags)
            .append(", ").append(m_description).append(" ]").toString();