|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.neu.ccs.demeter.dj.Visitor
| Constructor Summary | |
Visitor()
|
|
| Method Summary | |
void |
after(Object obj,
Class cl)
This method is called when a traversal has finished traversing obj in the object graph with cl as the
token. |
void |
after(Object source,
Class sourceClass,
EdgeI edge,
Object target,
Class targetClass)
This method is called when a traversal has finished traversing an edge in the object graph from source to
target corresponding to the class graph edge
edge from sourceClass to
targetClass. |
void |
before(Object obj,
Class cl)
This method is called when a traversal is about to traverse obj in the object graph with cl as the
token. |
void |
before(Object source,
Class sourceClass,
EdgeI edge,
Object target,
Class targetClass)
This method is called when a traversal is about to traverse an edge in the object graph from source to
target corresponding to the class graph edge
edge from sourceClass to
targetClass. |
void |
finish()
This method is called when a traversal ends, after all nodes have been visited. |
Method |
getMethod(String name,
Class[] paramTypes)
Return the method on this class named name with
parameter types paramTypes, or null if there is no such
method. |
Object |
getReturnValue()
This method is called on the first visitor (i.e. v[0]) after finish() has been called on all visitors in a traversal, and its return value is returned as the return value of the traversal. |
protected Method |
getUnmemoizedMethod(String name,
Class[] paramTypes)
Return the method on this class named name with
parameter types paramTypes, or null if there is no such
method. |
void |
invokeMethod(String name,
Object[] args,
Class[] paramTypes)
Invoke the method on this class named name with
parameter types paramTypes, passing args
as the arguments. |
void |
invokeMethod(String name,
Object obj,
Class cl)
Invoke the method on this class named name with one
parameter of type cl, passing obj as the
argument. |
void |
invokeMethods(String name,
Object source,
Class sourceClass,
EdgeI edge,
Object target,
Class targetClass)
Invoke the methods on this class whose names start with name and whose signatures correspond to the class graph
edge edge, passing source and
target (and the edge label, if it's a construction
edge) as arguments.
|
void |
start()
This method is called when a traversal begins, before any nodes are visited. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Visitor()
| Method Detail |
public void start()
public void finish()
public Object getReturnValue()
public void before(Object obj,
Class cl)
obj in the object graph with cl as the
token. Note that the same object might be passed to this method
multiple times, once per class in its inheritance hierarchy. The
default behavior is to call
invokeMethod("before", obj, cl).
public void after(Object obj,
Class cl)
obj in the object graph with cl as the
token. Note that the same object might be passed to this method
multiple times, once per class in its inheritance hierarchy.
The default behavior is to call
invokeMethod("after", obj, cl).
public void before(Object source,
Class sourceClass,
EdgeI edge,
Object target,
Class targetClass)
source to
target corresponding to the class graph edge
edge from sourceClass to
targetClass. The default behavior is to call
invokeMethods("before", source, sourceClass,
edge, target, targetClass).
public void after(Object source,
Class sourceClass,
EdgeI edge,
Object target,
Class targetClass)
source to
target corresponding to the class graph edge
edge from sourceClass to
targetClass. The default behavior is to call
invokeMethods("before", source, sourceClass,
edge, target, targetClass).
public void invokeMethods(String name,
Object source,
Class sourceClass,
EdgeI edge,
Object target,
Class targetClass)
name and whose signatures correspond to the class graph
edge edge, passing source and
target (and the edge label, if it's a construction
edge) as arguments.
For a construction edge, the following signatures are matched, in order:
_l(S, T)
_l(S, Object)
_l(Object, T)
_l(Object, Object)
(S, String, T)
(S, String, Object)
(Object, String, T)
(Object, String, Object)
name,
S is the source type of the edge,
l is the label of the edge, and
T is the target type of the edge.
For example, if an edge ->Employee,salary,Currency
is traversed, then first the visitor method
before_salary(Employee,Currency) is invoked,
if it exists, followed by
before_salary(Employee,Object), etc.
public void invokeMethod(String name,
Object obj,
Class cl)
name with one
parameter of type cl, passing obj as the
argument.
public void invokeMethod(String name,
Object[] args,
Class[] paramTypes)
name with
parameter types paramTypes, passing args
as the arguments.
public Method getMethod(String name,
Class[] paramTypes)
name with
parameter types paramTypes, or null if there is no such
method.
protected Method getUnmemoizedMethod(String name,
Class[] paramTypes)
name with
parameter types paramTypes, or null if there is no such
method.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||