|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.wpi.cs.dsrg.xmldb.xat.common.visitorpattern.InheritableVisitor
It used to visit the lowest level class to be visited first, then go to the parent class if cannot find the visit function. It use the reflective functions. This will be the chosen visitor implementation for others.
Constructor Summary | |
InheritableVisitor()
|
Method Summary | |
abstract java.lang.Object |
dispatch()
To visit a null object. |
abstract java.lang.Object |
dispatch(java.lang.Object obj)
To visit any object. |
protected java.util.Vector |
getAncestors(java.lang.Class c)
Get the ancestor of a specific class. |
protected java.lang.reflect.Method |
getMethod(java.lang.Class c)
The getMethod function will trying to get all the classes and also the interfaces from the lower level to the higher level to figure out which will be the proper method to invoke. |
java.lang.Object |
visit(java.lang.Object object)
If there is an inheretance between the visited objects, it will only match the highest class. |
java.lang.Object |
visit(Visitable v)
Well in some case, the visit() will call the visitable, which is the highest interface in the visitor pattern. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public InheritableVisitor()
Method Detail |
public abstract java.lang.Object dispatch()
public abstract java.lang.Object dispatch(java.lang.Object obj)
protected java.util.Vector getAncestors(java.lang.Class c)
c
- java.lang.Classprotected java.lang.reflect.Method getMethod(java.lang.Class c)
c
- The class to be visited.public java.lang.Object visit(Visitable v)
You should never ever visit(visitable) directly, but its subclasses.
v
- public java.lang.Object visit(java.lang.Object object)
object
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |