org.cli4j
Class ParseTree

java.lang.Object
  |
  +--org.cli4j.ParseTree

public class ParseTree
extends java.lang.Object

The ParseTree class models the command tree parsed from the command.xml file. It is used constantly by the CliDriver class.

Version:
@(#) $Id: ParseTree.html,v 1.2 2001/12/16 05:14:50 gmcallister Exp $
Author:
Glenn McAllister

Field Summary
static java.lang.String DEFAULT_EXIT_COMMAND
          The default command executed by the user to break out of a "sticky" command; this value is overriden by the exitCommand attribute of the command-tree element.
 
Constructor Summary
ParseTree()
          Create a new, empty parse tree.
 
Method Summary
 void addNode(Node topLevelNode)
          Add a top level command node to the root of the command tree.
 java.lang.String getExitCommand()
          Get the command the user executes to "break out" of a sticky command; if there is no sticky command, exit the application.
 java.lang.String getHelp()
           
 java.lang.String getInitCommandClass()
          Get the fully qualified class name that implements the Command interface to execute after the command tree is parsed and then initialized.
 java.lang.String getName()
          Get the name of the application.
 Node[] getNodes()
          Get all of the top level command nodes.
 java.lang.String getPrompt()
          Get the default console prompt.
 Node getRoot()
          The root node.
 java.lang.String getShutdownCommandClass()
           
 void setExitCommand(java.lang.String exitCommand)
          Set the command the user executes to "break out" of a sticky command.
 void setHelp(java.lang.String help)
           
 void setInitCommandClass(java.lang.String initClassName)
          Sets the fully qualified class name that implements the Command interface to execute after the command tree is parsed then initialized.
 void setName(java.lang.String name)
          Set the application name.
 void setPrompt(java.lang.String prompt)
          Set the default prompt.
 void setShutdownCommandClass(java.lang.String shutdownClassName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_EXIT_COMMAND

public static final java.lang.String DEFAULT_EXIT_COMMAND
The default command executed by the user to break out of a "sticky" command; this value is overriden by the exitCommand attribute of the command-tree element.
Constructor Detail

ParseTree

public ParseTree()
Create a new, empty parse tree.
Method Detail

getRoot

public Node getRoot()
The root node.

getPrompt

public java.lang.String getPrompt()
Get the default console prompt.

setPrompt

public void setPrompt(java.lang.String prompt)
Set the default prompt. This is a public method solely for the Digester.

getName

public java.lang.String getName()
Get the name of the application.

setName

public void setName(java.lang.String name)
Set the application name. This is a public method solely for the Digester.

addNode

public void addNode(Node topLevelNode)
Add a top level command node to the root of the command tree.
Parameters:
topLevelNode - a top level command.

getNodes

public Node[] getNodes()
Get all of the top level command nodes.

getInitCommandClass

public java.lang.String getInitCommandClass()
Get the fully qualified class name that implements the Command interface to execute after the command tree is parsed and then initialized.

setInitCommandClass

public void setInitCommandClass(java.lang.String initClassName)
Sets the fully qualified class name that implements the Command interface to execute after the command tree is parsed then initialized. This is a public method solely for the Digester.

getExitCommand

public java.lang.String getExitCommand()
Get the command the user executes to "break out" of a sticky command; if there is no sticky command, exit the application.

setExitCommand

public void setExitCommand(java.lang.String exitCommand)
Set the command the user executes to "break out" of a sticky command. This is a public method solely for the Digester.

getHelp

public java.lang.String getHelp()

setHelp

public void setHelp(java.lang.String help)

setShutdownCommandClass

public void setShutdownCommandClass(java.lang.String shutdownClassName)

getShutdownCommandClass

public java.lang.String getShutdownCommandClass()