public class CollectorVisitor<T> extends HierarchyVisitor
Modifier and Type | Field and Description |
---|---|
protected Collection<T> |
objects |
protected Class<T> |
type |
Constructor and Description |
---|
CollectorVisitor(Class<T> type) |
Modifier and Type | Method and Description |
---|---|
static Collection<ColumnReference> |
collectElements(LanguageObject object)
This is a utility method for a common use of this visitor, which is to collect
all elements in an object tree.
|
static Collection<NamedTable> |
collectGroups(LanguageObject object)
This is a utility method for a common use of this visitor, which is to collect
all groups in an object tree.
|
static Set<NamedTable> |
collectGroupsUsedByElements(LanguageObject object)
This is a utility method for a common use of this visitor, which is to collect
all groups used by all elements in an object tree.
|
static <T> Collection<T> |
collectObjects(Class<T> type,
LanguageObject object)
This is a utility method to instantiate and run the visitor in conjunction
with a HierarchyVisitor to collect all objects of the specified type
of the specified tree in the language object tree.
|
Collection<T> |
getCollectedObjects() |
void |
visitNode(LanguageObject obj)
Visit the LanguageObject instance to perform the Visitor's operation on
that instance.
|
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
visit, visit, visit, visit, visit, visit, visit, visitNodes, visitNodes
protected Collection<T> objects
public void visitNode(LanguageObject obj)
AbstractLanguageVisitor
visitNode
in class AbstractLanguageVisitor
obj
- an LanguageObject instanceHierarchyVisitor
public Collection<T> getCollectedObjects()
public static <T> Collection<T> collectObjects(Class<T> type, LanguageObject object)
type
- Language object type to look forobject
- Root of the language object treepublic static Collection<ColumnReference> collectElements(LanguageObject object)
object
- Root of the language object treepublic static Collection<NamedTable> collectGroups(LanguageObject object)
object
- Root of the language object treepublic static Set<NamedTable> collectGroupsUsedByElements(LanguageObject object)
object
- Root of the language object treeCopyright © 2020. All rights reserved.