org.pietschy.wizard.models
Class BranchingPath

java.lang.Object
  extended by org.pietschy.wizard.models.AbstractPath
      extended by org.pietschy.wizard.models.BranchingPath
All Implemented Interfaces:
Path

public class BranchingPath
extends AbstractPath

BranchingPaths represent a sequence of WizardSteps that has multiple choices for the next path to traverse.

See Also:
addBranch(org.pietschy.wizard.models.Path, org.pietschy.wizard.models.Condition), AbstractPath.addStep(org.pietschy.wizard.WizardStep)

Constructor Summary
BranchingPath()
          Creates a new empth BranchingPath.
BranchingPath(WizardStep step)
          Creates a new BranchingPath that is initialized with the specified step.
 
Method Summary
 void acceptVisitor(PathVisitor visitor)
           
 void addBranch(Path path, Condition condition)
          Adds a possible branch from this path.
protected  Path getNextPath(MultiPathModel model)
          Gets the path to traverse after this path has exhausted all its steps.
 void visitBranches(PathVisitor visitor)
           
 
Methods inherited from class org.pietschy.wizard.models.AbstractPath
addStep, contains, firstStep, getSteps, isFirstStep, isLastStep, lastStep, nextStep, previousStep
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BranchingPath

public BranchingPath()
Creates a new empth BranchingPath.


BranchingPath

public BranchingPath(WizardStep step)
Creates a new BranchingPath that is initialized with the specified step.

Parameters:
step - the first step of the path.
Method Detail

getNextPath

protected Path getNextPath(MultiPathModel model)
Gets the path to traverse after this path has exhausted all its steps. This method will call iterate over each path selector to determine the path to return.

Specified by:
getNextPath in class AbstractPath
Returns:
the next path in the sequence.
Throws:
java.lang.IllegalStateException - if no matching path is found.

addBranch

public void addBranch(Path path,
                      Condition condition)
Adds a possible branch from this path.

Parameters:
path - the AbstractPath to traverse based when the condition returns true.
condition - a Condition that activates this path.

acceptVisitor

public void acceptVisitor(PathVisitor visitor)
Specified by:
acceptVisitor in interface Path
Specified by:
acceptVisitor in class AbstractPath

visitBranches

public void visitBranches(PathVisitor visitor)