java.lang.Object
org.apache.wicket.util.visit.Visits
Utility class that contains visitor/traversal related code
-
Method Summary
Modifier and TypeMethodDescriptionstatic <S,R> R Visits container and its children pre-order (parent first).static <S,R> R visit(Iterable<? super S> container, IVisitor<S, R> visitor, IVisitFilter filter) Visits container and its children pre-order (parent first).static <S,R> R visitChildren(Iterable<? super S> container, IVisitor<S, R> visitor) Visits children of the specifiedIterablepre-order (parent first).static <S,R> R visitChildren(Iterable<? super S> container, IVisitor<S, R> visitor, IVisitFilter filter) Visits children of the specifiedIterablepre-order (parent first).static <S,R> R visitPostOrder(Object root, IVisitor<S, R> visitor, IVisitFilter filter) Visits the specified object and any of its children using a post-order (child first) traversal.static <S,R> R visitPostOrder(S root, IVisitor<S, R> visitor) Visits the specified object and any of its children using a post-order (child first) traversal.
-
Method Details
-
visit
Visits container and its children pre-order (parent first). Children are determined by callingIterable.iterator().- Type Parameters:
S- the type of object that will be visited, notice thatcontaineris not declared asIterable<S>because it may return a generalization ofSR- the type of object that should be returned from the visitor, useVoidif no return value is needed- Parameters:
container- object whose children will be visitedvisitor- the visitor- Returns:
- return value from the
visitorornullif none
-
visit
public static <S,R> R visit(Iterable<? super S> container, IVisitor<S, R> visitor, IVisitFilter filter) Visits container and its children pre-order (parent first). Children are determined by callingIterable.iterator().- Type Parameters:
S- the type of object that will be visited, notice thatcontaineris not declared asIterable<S>because it may return a generalization ofSR- the type of object that should be returned from the visitor, useVoidif no return value is needed- Parameters:
container- object whose children will be visitedvisitor- the visitorfilter- filter used to limit the types of objects that will be visited- Returns:
- return value from the
visitorornullif none
-
visitChildren
public static <S,R> R visitChildren(Iterable<? super S> container, IVisitor<S, R> visitor, IVisitFilter filter) Visits children of the specifiedIterablepre-order (parent first). Children are determined by callingIterable.iterator().- Type Parameters:
S- the type of object that will be visited, notice thatcontaineris not declared asIterable<S>because it may return a generalization ofSR- the type of object that should be returned from the visitor, useVoidif no return value is needed- Parameters:
container- object whose children will be visitedvisitor- the visitorfilter- filter used to limit the types of objects that will be visited- Returns:
- return value from the
visitorornullif none
-
visitChildren
Visits children of the specifiedIterablepre-order (parent first). Children are determined by callingIterable.iterator().- Type Parameters:
S- the type of object that will be visited, notice thatcontaineris not declared asIterable<S>because it may return a generalization ofSR- the type of object that should be returned from the visitor, useVoidif no return value is needed- Parameters:
container- object whose children will be visitedvisitor- the visitor- Returns:
- return value from the
visitorornullif none
-
visitPostOrder
Visits the specified object and any of its children using a post-order (child first) traversal. Children are determined by callingIterable.iterator()if the object implementsIterable.- Type Parameters:
S- the type of object that will be visited, notice thatcontaineris not declared asIterable<S>because it may return a generalization ofSR- the type of object that should be returned from the visitor, useVoidif no return value is needed- Parameters:
root- root object that will be visitedvisitor- the visitor- Returns:
- return value from the
visitorornullif none
-
visitPostOrder
Visits the specified object and any of its children using a post-order (child first) traversal. Children are determined by callingIterable.iterator()if the object implementsIterable.- Type Parameters:
S- the type of object that will be visited, notice thatcontaineris not declared asIterable<S>because it may return a generalization ofSR- the type of object that should be returned from the visitor, useVoidif no return value is needed- Parameters:
root- root object that will be visitedvisitor- the visitorfilter- filter used to limit the types of objects that will be visited- Returns:
- return value from the
visitorornullif none
-