org.sonatype.gshell.command.resolver
Class Node

java.lang.Object
  extended by org.sonatype.gshell.command.resolver.Node

@Singleton
public class Node
extends Object

A node for building a CommandAction tree.

Since:
2.5
Author:
Jason Dillon

Field Summary
static String CURRENT
           
static String PARENT
           
static String PATH_SEPARATOR
           
static String ROOT
           
static String SEPARATOR
           
 
Constructor Summary
Node(String name, CommandAction action)
           
Node(String name, CommandAction action, Node parent)
           
 
Method Summary
 void add(String name, CommandAction command)
           
 Collection<Node> children()
           
 Collection<Node> children(String name)
           
 Node find(NodePath path)
           
 Node find(String name)
           
 Node get(String name)
           
 CommandAction getAction()
           
 String getName()
           
 Node getParent()
           
 String getPath()
           
 int hashCode()
           
 boolean isGroup()
           
 boolean isLeaf()
           
 boolean isRoot()
           
 void remove(String name)
           
 Node root()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ROOT

public static final String ROOT
See Also:
Constant Field Values

PARENT

public static final String PARENT
See Also:
Constant Field Values

CURRENT

public static final String CURRENT
See Also:
Constant Field Values

SEPARATOR

public static final String SEPARATOR
See Also:
Constant Field Values

PATH_SEPARATOR

public static final String PATH_SEPARATOR
See Also:
Constant Field Values
Constructor Detail

Node

public Node(String name,
            CommandAction action,
            Node parent)

Node

public Node(String name,
            CommandAction action)
Method Detail

getName

public String getName()

getPath

public String getPath()

getAction

public CommandAction getAction()

getParent

public Node getParent()

isRoot

public boolean isRoot()

isLeaf

public boolean isLeaf()

isGroup

public boolean isGroup()

root

public Node root()

get

public Node get(String name)

children

public Collection<Node> children()

children

public Collection<Node> children(String name)

find

public Node find(String name)

find

public Node find(NodePath path)

add

public void add(String name,
                CommandAction command)

remove

public void remove(String name)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008-2011 Sonatype. All Rights Reserved.