com.google.template.soy.exprtree
Class AbstractOperatorNode

java.lang.Object
  extended by com.google.template.soy.basetree.AbstractNode
      extended by com.google.template.soy.exprtree.AbstractExprNode
          extended by com.google.template.soy.exprtree.AbstractParentExprNode
              extended by com.google.template.soy.exprtree.AbstractOperatorNode
All Implemented Interfaces:
Node, ParentNode<ExprNode>, ExprNode, ExprNode.OperatorNode, ExprNode.ParentExprNode
Direct Known Subclasses:
OperatorNodes.AndOpNode, OperatorNodes.ConditionalOpNode, OperatorNodes.DivideByOpNode, OperatorNodes.EqualOpNode, OperatorNodes.GreaterThanOpNode, OperatorNodes.GreaterThanOrEqualOpNode, OperatorNodes.LessThanOpNode, OperatorNodes.LessThanOrEqualOpNode, OperatorNodes.MinusOpNode, OperatorNodes.ModOpNode, OperatorNodes.NegativeOpNode, OperatorNodes.NotEqualOpNode, OperatorNodes.NotOpNode, OperatorNodes.NullCoalescingOpNode, OperatorNodes.OrOpNode, OperatorNodes.PlusOpNode, OperatorNodes.TimesOpNode

public abstract class AbstractOperatorNode
extends AbstractParentExprNode
implements ExprNode.OperatorNode

Abstract implementation of an OperatorNode.

Important: Do not use outside of Soy code (treat as superpackage-private).


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.google.template.soy.exprtree.ExprNode
ExprNode.ConstantNode, ExprNode.Kind, ExprNode.OperatorNode, ExprNode.ParentExprNode, ExprNode.PrimitiveNode
 
Field Summary
 
Fields inherited from class com.google.template.soy.basetree.AbstractNode
SPACES
 
Constructor Summary
protected AbstractOperatorNode(AbstractOperatorNode orig)
          Copy constructor.
  AbstractOperatorNode(Operator operator)
           
 
Method Summary
 Operator getOperator()
           
 String toSourceString()
          Builds a Soy source string that could be the source for this node.
 
Methods inherited from class com.google.template.soy.exprtree.AbstractParentExprNode
addChild, addChild, addChildren, addChildren, appendSourceStringForChildren, appendTreeStringForChildren, clearChildren, getChild, getChildIndex, getChildren, numChildren, removeChild, removeChild, replaceChild, replaceChild, toTreeString
 
Methods inherited from class com.google.template.soy.exprtree.AbstractExprNode
clone, getParent
 
Methods inherited from class com.google.template.soy.basetree.AbstractNode
getNearestAncestor, hasAncestor, setParent, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.template.soy.exprtree.ExprNode
clone, getKind, getParent
 
Methods inherited from interface com.google.template.soy.basetree.ParentNode
addChild, addChild, addChildren, addChildren, appendSourceStringForChildren, appendTreeStringForChildren, clearChildren, getChild, getChildIndex, getChildren, numChildren, removeChild, removeChild, replaceChild, replaceChild
 
Methods inherited from interface com.google.template.soy.basetree.Node
getNearestAncestor, hasAncestor, setParent, toTreeString
 

Constructor Detail

AbstractOperatorNode

public AbstractOperatorNode(Operator operator)

AbstractOperatorNode

protected AbstractOperatorNode(AbstractOperatorNode orig)
Copy constructor.

Parameters:
orig - The node to copy.
Method Detail

getOperator

public Operator getOperator()
Specified by:
getOperator in interface ExprNode.OperatorNode

toSourceString

public String toSourceString()
Description copied from interface: Node
Builds a Soy source string that could be the source for this node. Note that this is not the actual original source string, but a (sort of) canonical equivalent. Note: Some nodes do not have a direct mapping to Soy source (such as nodes created during some optimization passes). Thus this method may not always be supported.

Specified by:
toSourceString in interface Node
Returns:
A Soy string that could be the source for this node.