org.perfectjpattern.core.behavioral.visitor
Class DoVisitor

java.lang.Object
  extended by org.perfectjpattern.core.behavioral.visitor.DoVisitor
All Implemented Interfaces:
IVisitor<ICarPart>

public class DoVisitor
extends Object
implements IVisitor<ICarPart>

Concrete Visitor implementation that exemplifies the case where your Visitor already inherits from another class and thus can not extend PerfectJPattern's base reusable AbstractVisitor implementation.

Version:
$Revision: 1.0 $Date: Jun 8, 2008 11:59:05 PM $
Author:
Giovanni Azua
 

Constructor Summary
DoVisitor()
           
 
Method Summary
protected static void setLogger(org.slf4j.Logger aLogger)
           
 void visit(ICarPart anElement)
          Abstract definition of the Visitor's Pattern visit method.
 void visitBody(Body aBody)
          Visit Body
 void visitCar(Car aCar)
          Visit Car
 void visitEngine(Engine anEngine)
          Visit Engine
 void visitWheel(Wheel aWheel)
          Visit Wheel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoVisitor

public DoVisitor()
Method Detail

visit

public void visit(ICarPart anElement)
Abstract definition of the Visitor's Pattern visit method. This method will alone handle the dynamic double-dispatch operation avoiding the need for a counterpart accept method in the IElement hierarchy. First the visit method will resolve to the base Visitor implementation's by dynamic invocation i.e. overriding. Then the base Visitor implementation will lookup automatically by a second dynamic dispatch mechanism the right Visitor's visit implementation depending on the concrete IElement sub-type.

Specified by:
visit in interface IVisitor<ICarPart>
Parameters:
anElement - IElement instance to visit.

visitWheel

public void visitWheel(Wheel aWheel)
Visit Wheel

Parameters:
aWheel -

visitEngine

public void visitEngine(Engine anEngine)
Visit Engine

Parameters:
anEngine -

visitBody

public void visitBody(Body aBody)
Visit Body

Parameters:
aBody -

visitCar

public void visitCar(Car aCar)
Visit Car

Parameters:
aCar -

setLogger

protected static void setLogger(org.slf4j.Logger aLogger)


Copyright © 2007-2009. All Rights Reserved.