|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
T - the type of the result that this visitor returns
(can be defined as Void to denote no result}.public interface ObjectVisitor<T>
A visitor that controls an object traversal. Implementations
of this interface are passed to ObjectExplorer exploration methods.
ObjectExplorer| Nested Class Summary | |
|---|---|
static class |
ObjectVisitor.Traversal
Constants that denote how the traversal of a given object (chain) should continue. |
| Method Summary | |
|---|---|
T |
result()
Returns an arbitrary value (presumably constructed during the object graph traversal). |
ObjectVisitor.Traversal |
visit(Chain chain)
Visits an explored value (the whole chain from the root object leading to the value is provided), and decides whether to continue the exploration of that value. |
| Method Detail |
|---|
ObjectVisitor.Traversal visit(Chain chain)
In case the explored value is either primitive or null
(e.g., if chain.isPrimitive() || chain.getValue() == null),
the return value is meaningless and is ignored.
chain - the chain that leads to the explored value.
Traversal.EXPLORE to denote that the visited object
should be further explored, or ObjectVisitor.Traversal.SKIP to avoid
exploring it.T result()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||