-
Class Summary
| Class |
Description |
| Option |
The class Option represents an object of a command line system.
|
| OptionFlag |
This class OptionFlag represents an object of an option flag.
|
| OptionItem |
This class represents the basic elements of an option list.
|
| OptionList<E> |
This OptionList class includes basic operations for a option list.
|
| OptionMain |
This class provides an example of using CmdLineSyntax package and OptionTest.
|
| OptionTest |
This class demonstrates how to customize specific command line syntax by
using this package.
|
| OptionUtility |
This class provides utility functions for Option operations.
|
| SystemOption |
This is an abstract class for all systems to use and setup system command
line syntax.
|
Package gov.nih.nlm.nls.lvg.CmdLineSyntax Description
Provides Java classes necessary to create a command line system.
This package provides an API for build a command line system (up to five levels).
Basically, a command is composed of program and options. An option is a linked list composed of option items. An option item composed by option flags and option arguments.
Features
Bellows are some features of this package:
- The system option can be flexibly assigned by defining a String.
- The syntax of an input command can be checked automatically by the system.
- Possible command(s) will be suggested by the system if there is an error on the input option. Two types of system options are suggested:
- An optionItem with same level as the input option where first error happens.
- An optionItem includes the input option item where error happens.
- Each optionFlag has two names, abbreviation and full name.
- Provides methods for converting abbreviation name and full name of flags for optinItem.
- Provides methods of printing hierarchy structure of a given option.
- Provides methods of printing all optionItems.
Usage
- Includes this package (import Lvg.CmdLineSyntax.*)
- Create a class, e.g. foo, and make it extends SystemOption (refer to OptionTest)
- Define the system option flag by defining an option string in DefineFlag().
- Define all flag full name (if any) in DefineFlag() in foo.
- Define what to do for each option in ExecuteCommand() in foo.
- Define main() in foo.
- Define help menu for each option if needed.
Related Documents
- Since:
- 2002