fabric.common
Class Options

java.lang.Object
  extended by fabric.common.Options
Direct Known Subclasses:
Options, Options

public abstract class Options
extends java.lang.Object


Field Summary
static boolean DEBUG_NO_SSL
          Whether to turn off SSL encryption for debugging purposes.
protected static int USAGE_FLAG_WIDTH
          The number of spaces from the left that the description for flags will be displayed.
protected static int USAGE_SCREEN_WIDTH
          The maximum width of a line when printing usage information.
 
Constructor Summary
protected Options()
           
protected Options(java.lang.String[] args)
           
 
Method Summary
protected abstract  int parseCommand(java.lang.String[] args, int index)
          Parses a command.
 void parseCommandLine(java.lang.String[] args)
           
protected abstract  void setDefaultValues()
           
protected static void usageForFlag(java.io.PrintStream out, java.lang.String flag, java.lang.String desc)
          Output a flag and a description of its usage in a nice format.
protected static void usageForFlag(java.io.PrintStream out, java.lang.String flag, java.lang.String desc, int defVal)
          Output a flag and a description of its usage in a nice format.
protected static void usageForFlag(java.io.PrintStream out, java.lang.String flag, java.lang.String desc, java.lang.String defVal)
          Output a flag and a description of its usage in a nice format.
protected abstract  void validateOptions()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG_NO_SSL

public static boolean DEBUG_NO_SSL
Whether to turn off SSL encryption for debugging purposes.


USAGE_SCREEN_WIDTH

protected static final int USAGE_SCREEN_WIDTH
The maximum width of a line when printing usage information. Used by usageForFlag.

See Also:
Constant Field Values

USAGE_FLAG_WIDTH

protected static final int USAGE_FLAG_WIDTH
The number of spaces from the left that the description for flags will be displayed. Used by usageForFlag.

See Also:
Constant Field Values
Constructor Detail

Options

protected Options()

Options

protected Options(java.lang.String[] args)
           throws UsageError
Throws:
UsageError
Method Detail

setDefaultValues

protected abstract void setDefaultValues()

validateOptions

protected abstract void validateOptions()
                                 throws UsageError
Throws:
UsageError

parseCommand

protected abstract int parseCommand(java.lang.String[] args,
                                    int index)
                             throws UsageError
Parses a command.

Returns:
the next index to process. i.e., if calling this method processes two commands, then the return value should be index+2.
Throws:
UsageError

parseCommandLine

public void parseCommandLine(java.lang.String[] args)
                      throws UsageError
Throws:
UsageError

usageForFlag

protected static void usageForFlag(java.io.PrintStream out,
                                   java.lang.String flag,
                                   java.lang.String desc)
Output a flag and a description of its usage in a nice format.

Parameters:
out - output PrintStream
flag - the name of the flag.
desc - description of the flag.

usageForFlag

protected static void usageForFlag(java.io.PrintStream out,
                                   java.lang.String flag,
                                   java.lang.String desc,
                                   java.lang.String defVal)
Output a flag and a description of its usage in a nice format.

Parameters:
out - output PrintStream
flag - the name of the flag.
desc - description of the flag.
defVal - default value

usageForFlag

protected static void usageForFlag(java.io.PrintStream out,
                                   java.lang.String flag,
                                   java.lang.String desc,
                                   int defVal)
Output a flag and a description of its usage in a nice format.

Parameters:
out - output PrintStream
flag - the name of the flag.
desc - description of the flag.
defVal - default value