org.pietschy.wizard.models
Class BranchingPath

java.lang.Object
  extended byorg.pietschy.wizard.models.Path
      extended byorg.pietschy.wizard.models.BranchingPath

public class BranchingPath
extends Path

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), Path.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.Path
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 Path
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 Path 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 class Path

visitBranches

public void visitBranches(PathVisitor visitor)


Copyright © 2004 Andrew Pietsch.