public class RecursionChecker
extends java.lang.Object
beforeVisit(hu.elte.eserial.model.EserialElement) should be called with the element to visit.canVisit(hu.elte.eserial.model.EserialElement) tells whether this
element is allowed to be visited.afterVisit(hu.elte.eserial.model.EserialElement) should be called to
signal the end of the visit.| Constructor and Description |
|---|
RecursionChecker(java.lang.Object root) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterVisit(EserialElement element)
Removes the
element and all of its children from the recursion checking. |
void |
beforeVisit(EserialElement element)
Saves the element for later checking of possible recursions.
|
boolean |
canVisit(EserialElement element) |
public boolean canVisit(EserialElement element)
element - the element to check before visiting ittrue if the element has not already been visited and it's not the root of the map.public void beforeVisit(EserialElement element)
element - the element to be visitedpublic void afterVisit(EserialElement element)
element and all of its children from the recursion checking.element - the element that has been visited