Package org.apache.wicket.util.visit
Class Visits
- java.lang.Object
-
- org.apache.wicket.util.visit.Visits
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <S,R>
Rvisit(Iterable<? super S> container, IVisitor<S,R> visitor)
Visits container and its children pre-order (parent first).static <S,R>
Rvisit(Iterable<? super S> container, IVisitor<S,R> visitor, IVisitFilter filter)
Visits container and its children pre-order (parent first).static <S,R>
RvisitChildren(Iterable<? super S> container, IVisitor<S,R> visitor)
Visits children of the specifiedIterable
pre-order (parent first).static <S,R>
RvisitChildren(Iterable<? super S> container, IVisitor<S,R> visitor, IVisitFilter filter)
Visits children of the specifiedIterable
pre-order (parent first).static <S,R>
RvisitPostOrder(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>
RvisitPostOrder(S root, IVisitor<S,R> visitor)
Visits the specified object and any of its children using a post-order (child first) traversal.
-
-
-
Method Detail
-
visit
public static <S,R> R visit(Iterable<? super S> container, IVisitor<S,R> visitor)
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 thatcontainer
is not declared asIterable<S>
because it may return a generalization ofS
R
- the type of object that should be returned from the visitor, useVoid
if no return value is needed- Parameters:
container
- object whose children will be visitedvisitor
- the visitor- Returns:
- return value from the
visitor
ornull
if 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 thatcontainer
is not declared asIterable<S>
because it may return a generalization ofS
R
- the type of object that should be returned from the visitor, useVoid
if 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
visitor
ornull
if none
-
visitChildren
public static <S,R> R visitChildren(Iterable<? super S> container, IVisitor<S,R> visitor, IVisitFilter filter)
Visits children of the specifiedIterable
pre-order (parent first). Children are determined by callingIterable.iterator()
.- Type Parameters:
S
- the type of object that will be visited, notice thatcontainer
is not declared asIterable<S>
because it may return a generalization ofS
R
- the type of object that should be returned from the visitor, useVoid
if 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
visitor
ornull
if none
-
visitChildren
public static <S,R> R visitChildren(Iterable<? super S> container, IVisitor<S,R> visitor)
Visits children of the specifiedIterable
pre-order (parent first). Children are determined by callingIterable.iterator()
.- Type Parameters:
S
- the type of object that will be visited, notice thatcontainer
is not declared asIterable<S>
because it may return a generalization ofS
R
- the type of object that should be returned from the visitor, useVoid
if no return value is needed- Parameters:
container
- object whose children will be visitedvisitor
- the visitor- Returns:
- return value from the
visitor
ornull
if none
-
visitPostOrder
public 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. Children are determined by callingIterable.iterator()
if the object implementsIterable
.- Type Parameters:
S
- the type of object that will be visited, notice thatcontainer
is not declared asIterable<S>
because it may return a generalization ofS
R
- the type of object that should be returned from the visitor, useVoid
if no return value is needed- Parameters:
root
- root object that will be visitedvisitor
- the visitor- Returns:
- return value from the
visitor
ornull
if none
-
visitPostOrder
public 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. Children are determined by callingIterable.iterator()
if the object implementsIterable
.- Type Parameters:
S
- the type of object that will be visited, notice thatcontainer
is not declared asIterable<S>
because it may return a generalization ofS
R
- the type of object that should be returned from the visitor, useVoid
if 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
visitor
ornull
if none
-
-