net.sf.sasl.language.placeholder.syntax
Class SimplePrefixTreeWalker

java.lang.Object
  extended by net.sf.sasl.language.placeholder.syntax.SimplePrefixTreeWalker
All Implemented Interfaces:
ITreeWalker

public class SimplePrefixTreeWalker
extends Object
implements ITreeWalker

A simple tree walker to walk an abstract placeholder syntax tree. Puffers all nodes to which the class filter applies at the construction of an object instance. The nodes will be visited in prefix order (root child1 ... childN).

Since:
0.0.1 (sasl-common-aspect-library)
Author:
Philipp Förmer

Constructor Summary
SimplePrefixTreeWalker(ASTNode rootNode, Class<? extends ASTNode>... filterClasses)
           
 
Method Summary
 ASTNode getCurrentNode()
          Returns the current visited node returned by a call to ITreeWalker.nextNode().
 ASTNode nextNode()
          Visits the next node in the tree and returns it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimplePrefixTreeWalker

public SimplePrefixTreeWalker(ASTNode rootNode,
                              Class<? extends ASTNode>... filterClasses)
Parameters:
rootNode - null or non null root node of the abstract syntax tree from which the traveling should start.
filterClasses - null or non null array of node classes which only should get visited. If null, all nodes will be visited.
Since:
0.0.1 (sasl-common-aspect-library)
Method Detail

getCurrentNode

public ASTNode getCurrentNode()
Description copied from interface: ITreeWalker
Returns the current visited node returned by a call to ITreeWalker.nextNode().

Specified by:
getCurrentNode in interface ITreeWalker
Returns:
null or non null
See Also:
ITreeWalker.getCurrentNode()

nextNode

public ASTNode nextNode()
Description copied from interface: ITreeWalker
Visits the next node in the tree and returns it. Returns null if there are no more nodes in the tree to visit.

Specified by:
nextNode in interface ITreeWalker
Returns:
null or non null
See Also:
ITreeWalker.nextNode()


Copyright © 2010. All Rights Reserved.