com.metamatrix.query.sql.visitor
Class AbstractSymbolMappingVisitor

java.lang.Object
  extended by com.metamatrix.query.sql.LanguageVisitor
      extended by com.metamatrix.query.sql.visitor.ExpressionMappingVisitor
          extended by com.metamatrix.query.sql.visitor.AbstractSymbolMappingVisitor
Direct Known Subclasses:
StaticSymbolMappingVisitor, XMLNodeMappingVisitor

public abstract class AbstractSymbolMappingVisitor
extends ExpressionMappingVisitor

This class is used to update LanguageObjects by replacing one set of symbols with another. There is one abstract method which must be overridden to define how the mapping lookup occurs.


Constructor Summary
protected AbstractSymbolMappingVisitor()
           
 
Method Summary
protected abstract  Symbol getMappedSymbol(Symbol symbol)
          Get the mapped symbol from the specified symbol.
 java.util.List getUnmappedSymbols()
          Get all symbols that were not mapped during life of visitor.
 Expression replaceExpression(Expression element)
           
 void visit(AllInGroupSymbol obj)
          Swap each ElementSymbol referenced by AllInGroupSymbol
 void visit(AllSymbol obj)
          Swap each ElementSymbol referenced by AllSymbol
 void visit(CriteriaSelector obj)
          Swap elements in CriteriaSelector
 void visit(Delete obj)
           This method updates the Delete object it receives as an argument by replacing the virtual groups/elements with their physical counterparts.
 void visit(Insert obj)
           This method updates the Insert object it receives as an argument by replacing the virtual groups/elements with their physical counterparts.
 void visit(SetClause obj)
           
 void visit(StoredProcedure obj)
          Swap name of stored proc and elements in stored procedure parameter expressions
 void visit(UnaryFromClause obj)
          Swap group in unary from clause.
 void visit(Update obj)
           This method updates the Update object it receives as an argument by replacing the virtual groups/elements with their physical counterparts.
 
Methods inherited from class com.metamatrix.query.sql.visitor.ExpressionMappingVisitor
createAliases, getVariableValues, mapExpressions, setVariableValues, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSymbolMappingVisitor

protected AbstractSymbolMappingVisitor()
Method Detail

getMappedSymbol

protected abstract Symbol getMappedSymbol(Symbol symbol)
Get the mapped symbol from the specified symbol. Subclasses should implement this method to look up the target symbol from the specified symbol.

Parameters:
symbol - Source symbol
Returns:
Target symbol

visit

public void visit(Insert obj)

This method updates the Insert object it receives as an argument by replacing the virtual groups/elements with their physical counterparts.

Overrides:
visit in class ExpressionMappingVisitor
Parameters:
obj - The Insert object to be updated with physical groups/elements
See Also:
LanguageVisitor.visit(com.metamatrix.query.sql.lang.Insert)

visit

public void visit(Delete obj)

This method updates the Delete object it receives as an argument by replacing the virtual groups/elements with their physical counterparts.

Overrides:
visit in class LanguageVisitor
Parameters:
obj - The Delete object to be updated with physical groups

visit

public void visit(Update obj)

This method updates the Update object it receives as an argument by replacing the virtual groups/elements with their physical counterparts.

Overrides:
visit in class LanguageVisitor
Parameters:
obj - The Update object to be updated with physical groups

visit

public void visit(SetClause obj)
Overrides:
visit in class ExpressionMappingVisitor

visit

public void visit(AllInGroupSymbol obj)
Swap each ElementSymbol referenced by AllInGroupSymbol

Overrides:
visit in class LanguageVisitor
Parameters:
obj - Object to remap

visit

public void visit(AllSymbol obj)
Swap each ElementSymbol referenced by AllSymbol

Overrides:
visit in class LanguageVisitor
Parameters:
obj - Object to remap

visit

public void visit(UnaryFromClause obj)
Swap group in unary from clause.

Overrides:
visit in class LanguageVisitor
Parameters:
obj - Object to remap

visit

public void visit(StoredProcedure obj)
Swap name of stored proc and elements in stored procedure parameter expressions

Overrides:
visit in class ExpressionMappingVisitor
Parameters:
obj - Object to remap

visit

public void visit(CriteriaSelector obj)
Swap elements in CriteriaSelector

Overrides:
visit in class LanguageVisitor
Parameters:
obj - Object to remap

replaceExpression

public Expression replaceExpression(Expression element)
Overrides:
replaceExpression in class ExpressionMappingVisitor
See Also:
ExpressionMappingVisitor.replaceExpression(com.metamatrix.query.sql.symbol.Expression)

getUnmappedSymbols

public java.util.List getUnmappedSymbols()
Get all symbols that were not mapped during life of visitor. If all symbols were mapped, this will return null.

Returns:
List of ElementSymbol and GroupSymbol that were unmapped OR null if all symbols mapped successfully


Copyright © 2009. All Rights Reserved.