Modifier and Type | Method and Description |
---|---|
static <R> void |
checkVisitorRules(Visitor<R> visitor)
Prints a warning to stderr about any visitXXX methods
of the provided visitor that may not be called
because it does not implement the associated interface.
|
static boolean |
transitivelyCheckVisitorRules(Object o)
Transitive visitor utils.
|
static <R> boolean |
visitArray(Visitor<R> visitor,
Object[] array)
Visits all the terms (instances of
Term ) contained in
the array by calling the accept-method with
the provided visitor as argument. |
static <T extends Term> |
visitTerm(Visitor<?> visitor,
T term,
boolean share)
Visits a term by visiting all its children returned via its
getChildren method . |
static <R> void |
visitTerm(Visitor<R> visitor,
Term term)
Visits a term by visiting all its children returned via
the getChildren method of Term.
|
public static <R> boolean visitArray(Visitor<R> visitor, Object[] array)
Visits all the terms (instances of Term
) contained in
the array by calling the accept-method
with
the provided visitor as argument. The array is changed to
contain the results of the visit calls. The return value
indicates whether the array has changed, i.e., whether the return
value of one of the visit calls was different to the term to
which the accept method was applied.
visitor
- the visitor used for visiting the terms.array
- the array (should not be null
) to be visited,
updated to contain the results of the visit calls.public static <T extends Term> T visitTerm(Visitor<?> visitor, T term, boolean share)
Visits a term by visiting all its children returned via its
getChildren method
. The returned term
has the return values of the correpsonding visit-calls as
children. Annotations are preserved.
visitor
- the Visitor used for visiting the children of the term.term
- the term to be visited.share
- a flag used to indicate whether a term whos children are
returned unchanged by the visitor should be shared
(returned without copying).term
is returned unchanged
iff each visit call returns the object it is visiting and
share
is true
.IllegalArgumentException
- if a new term cannot be created using
the new children.NullPointerException
- if term
is null
.public static <R> void visitTerm(Visitor<R> visitor, Term term)
Visits a term by visiting all its children returned via the getChildren method of Term.
public static <R> void checkVisitorRules(Visitor<R> visitor)
visitor
- the visitor to be checked.public static boolean transitivelyCheckVisitorRules(Object o)
Copyright © 2003–2016 Community Z Tools Project. All rights reserved.