com.google.template.soy.soytree
Class TemplateBasicNode

java.lang.Object
  extended by com.google.template.soy.basetree.AbstractNode
      extended by com.google.template.soy.soytree.AbstractSoyNode
          extended by com.google.template.soy.soytree.AbstractCommandNode
              extended by com.google.template.soy.soytree.AbstractParentCommandNode<SoyNode.StandaloneNode>
                  extended by com.google.template.soy.soytree.AbstractBlockCommandNode
                      extended by com.google.template.soy.soytree.TemplateNode
                          extended by com.google.template.soy.soytree.TemplateBasicNode
All Implemented Interfaces:
Node, ParentNode<SoyNode.StandaloneNode>, SoyNode, SoyNode.BlockCommandNode, SoyNode.BlockNode, SoyNode.CommandNode, SoyNode.ParentSoyNode<SoyNode.StandaloneNode>, SoyNode.RenderUnitNode

public class TemplateBasicNode
extends TemplateNode

Node representing a basic template.

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


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.template.soy.soytree.TemplateNode
TemplateNode.SoyDocParam, TemplateNode.SoyFileHeaderInfo
 
Nested classes/interfaces inherited from interface com.google.template.soy.soytree.SoyNode
SoyNode.BlockCommandNode, SoyNode.BlockNode, SoyNode.CommandNode, SoyNode.ConditionalBlockNode, SoyNode.ExprHolderNode, SoyNode.Kind, SoyNode.LocalVarBlockNode, SoyNode.LocalVarInlineNode, SoyNode.LocalVarNode, SoyNode.LoopNode, SoyNode.MsgBlockNode, SoyNode.MsgPlaceholderInitialNode, SoyNode.ParentSoyNode<N extends SoyNode>, SoyNode.RenderUnitNode, SoyNode.SplitLevelTopNode<N extends SoyNode>, SoyNode.StandaloneNode, SoyNode.StatementNode, SoyNode.SyntaxVersion
 
Field Summary
 
Fields inherited from class com.google.template.soy.soytree.TemplateNode
MAX_PRIORITY
 
Fields inherited from class com.google.template.soy.basetree.AbstractNode
SPACES
 
Constructor Summary
  TemplateBasicNode(int id, TemplateNode.SoyFileHeaderInfo soyFileHeaderInfo, String commandText, String soyDoc)
          Creates a TemplateNode given the source command text.
  TemplateBasicNode(int id, TemplateNode.SoyFileHeaderInfo soyFileHeaderInfo, String templateName, String partialTemplateName, boolean useAttrStyleForName, boolean isOverride, boolean isPrivate, AutoescapeMode autoescapeMode, SanitizedContent.ContentKind contentKind, String soyDoc, SoyNode.SyntaxVersion syntaxVersion)
          Creates a TemplateNode given values for fields.
protected TemplateBasicNode(TemplateBasicNode orig)
          Copy constructor.
 
Method Summary
 TemplateBasicNode clone()
          Clones this node.
 SoyNode.Kind getKind()
          Returns this node's kind (corresponding to this node's specific type).
 String getTemplateNameForUserMsgs()
          Returns a template name suitable for display in user msgs.
 boolean isOverride()
          Returns whether this template overrides another (always false for syntax version V2).
 
Methods inherited from class com.google.template.soy.soytree.TemplateNode
clearSoyDocStrings, getAutoescapeMode, getContentKind, getDelPackageName, getParamSrcsWithIncorrectSyntax, getParent, getPartialTemplateName, getSoyDoc, getSoyDocDesc, getSoyDocParams, getSoyFileHeaderInfo, getTemplateName, isPrivate, toSourceString
 
Methods inherited from class com.google.template.soy.soytree.AbstractParentCommandNode
addChild, addChild, addChildren, addChildren, appendSourceStringForChildren, appendTreeStringForChildren, clearChildren, getChild, getChildIndex, getChildren, needsEnvFrameDuringInterp, numChildren, removeChild, removeChild, replaceChild, replaceChild, setNeedsEnvFrameDuringInterp, toTreeString
 
Methods inherited from class com.google.template.soy.soytree.AbstractCommandNode
buildTagStringHelper, buildTagStringHelper, getCommandName, getCommandText, getTagString
 
Methods inherited from class com.google.template.soy.soytree.AbstractSoyNode
getId, getSourceLocation, getSyntaxVersion, maybeSetSyntaxVersion, setId, setSourceLocation, toString
 
Methods inherited from class com.google.template.soy.basetree.AbstractNode
getNearestAncestor, hasAncestor, setParent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.template.soy.soytree.SoyNode.CommandNode
getCommandName, getCommandText, getTagString
 
Methods inherited from interface com.google.template.soy.soytree.SoyNode.ParentSoyNode
needsEnvFrameDuringInterp, setNeedsEnvFrameDuringInterp
 
Methods inherited from interface com.google.template.soy.soytree.SoyNode
getId, getSourceLocation, getSyntaxVersion, setId, setSourceLocation
 
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

TemplateBasicNode

public TemplateBasicNode(int id,
                         TemplateNode.SoyFileHeaderInfo soyFileHeaderInfo,
                         String commandText,
                         @Nullable
                         String soyDoc)
                  throws SoySyntaxException
Creates a TemplateNode given the source command text.

Parameters:
id - The id for this node.
soyFileHeaderInfo - Info from the containing Soy file's header declarations.
commandText - The command text.
soyDoc - The full SoyDoc, including the start/end tokens, or null if the template is not preceded by SoyDoc.
Throws:
SoySyntaxException - If a syntax error is found.

TemplateBasicNode

public TemplateBasicNode(int id,
                         TemplateNode.SoyFileHeaderInfo soyFileHeaderInfo,
                         String templateName,
                         @Nullable
                         String partialTemplateName,
                         boolean useAttrStyleForName,
                         boolean isOverride,
                         boolean isPrivate,
                         AutoescapeMode autoescapeMode,
                         SanitizedContent.ContentKind contentKind,
                         @Nullable
                         String soyDoc,
                         SoyNode.SyntaxVersion syntaxVersion)
Creates a TemplateNode given values for fields.

Parameters:
soyFileHeaderInfo - Info from the containing Soy file's header declarations.
templateName - The full template name.
partialTemplateName - The template name without any namespace, or null for templates in V1 syntax.
useAttrStyleForName - true to use an attribute to specify the name. This is purely cosmetic.
isOverride - True iff the template overrides another (false for V2).
isPrivate - True iff the template can only be used by other templates from the same file
autoescapeMode - Specifies how {print} commands are escaped.

TemplateBasicNode

protected TemplateBasicNode(TemplateBasicNode orig)
Copy constructor.

Parameters:
orig - The node to copy.
Method Detail

getKind

public SoyNode.Kind getKind()
Description copied from interface: SoyNode
Returns this node's kind (corresponding to this node's specific type).


getTemplateNameForUserMsgs

public String getTemplateNameForUserMsgs()
Description copied from class: TemplateNode
Returns a template name suitable for display in user msgs.

Specified by:
getTemplateNameForUserMsgs in class TemplateNode

isOverride

public boolean isOverride()
Returns whether this template overrides another (always false for syntax version V2).


clone

public TemplateBasicNode clone()
Description copied from interface: Node
Clones this node. The clone's parent pointer is set to null.

Specified by:
clone in interface Node
Specified by:
clone in interface SoyNode
Specified by:
clone in class AbstractSoyNode
Returns:
A clone of this code.