|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.perfectjpattern.core.behavioral.visitor.DoVisitor
public class DoVisitor
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.
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 |
---|
public DoVisitor()
Method Detail |
---|
public void visit(ICarPart anElement)
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.
public void visitWheel(Wheel aWheel)
aWheel
- public void visitEngine(Engine anEngine)
anEngine
- public void visitBody(Body aBody)
aBody
- public void visitCar(Car aCar)
aCar
- protected static void setLogger(org.slf4j.Logger aLogger)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |