com.metamatrix.query.sql.visitor
Class ReferenceCollectorVisitor

java.lang.Object
  extended by com.metamatrix.query.sql.LanguageVisitor
      extended by com.metamatrix.query.sql.visitor.ReferenceCollectorVisitor

public class ReferenceCollectorVisitor
extends LanguageVisitor

This visitor class will traverse a language object tree and collect all references it finds.

The easiest way to use this visitor is to call the static methods which create the visitor (and possibly the collection), run the visitor, and return the collection. The public visit() methods should NOT be called directly.


Constructor Summary
ReferenceCollectorVisitor()
           
 
Method Summary
 java.util.List<Reference> getReferences()
          Get the references collected by the visitor.
static java.util.List<Reference> getReferences(LanguageObject obj)
          Helper to quickly get the references from obj in a collection.
 void visit(Reference obj)
          Visit a language object and collect symbols.
 
Methods inherited from class com.metamatrix.query.sql.LanguageVisitor
setAbort, shouldAbort, 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, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferenceCollectorVisitor

public ReferenceCollectorVisitor()
Method Detail

getReferences

public java.util.List<Reference> getReferences()
Get the references collected by the visitor. This should best be called after the visitor has been run on the language object tree.

Returns:
Collection of ElementSymbol

visit

public void visit(Reference obj)
Visit a language object and collect symbols. This method should NOT be called directly.

Overrides:
visit in class LanguageVisitor
Parameters:
obj - Language object

getReferences

public static java.util.List<Reference> getReferences(LanguageObject obj)
Helper to quickly get the references from obj in a collection.

Parameters:
obj - Language object
Returns:
List of Reference


Copyright © 2009. All Rights Reserved.