public abstract class TemplateNodeBuilder extends Object
Important: Do not use outside of Soy code (treat as superpackage-private).
| Modifier and Type | Field and Description |
|---|---|
protected String |
cmdText
The command text.
|
protected static com.google.common.collect.ImmutableSet<String> |
COMMON_ATTRIBUTE_NAMES |
protected ErrorReporter |
errorReporter
For reporting parse errors.
|
protected Integer |
id
The id for this node.
|
protected boolean |
isMarkedV1 |
protected com.google.common.collect.ImmutableList<TemplateParam> |
params
The params from template header and/or SoyDoc.
|
protected String |
soyDoc
The full SoyDoc, including the start/end tokens, or null.
|
protected String |
soyDocDesc
The description portion of the SoyDoc (before declarations), or null.
|
protected TemplateNode.SoyFileHeaderInfo |
soyFileHeaderInfo
Info from the containing Soy file's header declarations.
|
protected boolean |
strictHtmlDisabled |
protected SyntaxVersionUpperBound |
syntaxVersionBound
The lowest known syntax version bound.
|
protected Visibility |
visibility
This template's visibility level.
|
| Modifier | Constructor and Description |
|---|---|
protected |
TemplateNodeBuilder(TemplateNode.SoyFileHeaderInfo soyFileHeaderInfo,
ErrorReporter errorReporter) |
| Modifier and Type | Method and Description |
|---|---|
TemplateNodeBuilder |
addParams(Iterable<? extends TemplateParam> newParams)
Helper for
setSoyDoc() and setHeaderDecls(). |
abstract TemplateNode |
build()
Builds the template node.
|
protected AutoescapeMode |
getAutoescapeMode() |
SanitizedContentKind |
getContentKind() |
protected String |
getCssBaseNamespace() |
protected String |
getPartialTemplateName() |
protected com.google.common.collect.ImmutableList<String> |
getRequiredCssNamespaces() |
protected boolean |
getStrictHtmlDisabled() |
protected String |
getTemplateName() |
protected void |
markDeprecatedV1(boolean isDeprecatedV1) |
protected void |
setAutoescapeInfo(AutoescapeMode autoescapeMode,
SanitizedContentKind contentKind,
SourceLocation kindLocation) |
abstract TemplateNodeBuilder |
setCommandValues(Identifier name,
List<CommandTagAttribute> attrs)
Set the parsed data from the command tag.
|
protected void |
setCommonCommandValues(List<CommandTagAttribute> attrs) |
protected void |
setCssBaseNamespace(String cssBaseNamespace) |
TemplateNodeBuilder |
setId(int id)
Sets the id for the node to be built.
|
protected void |
setRequiredCssNamespaces(com.google.common.collect.ImmutableList<String> requiredCssNamespaces) |
TemplateNodeBuilder |
setSourceLocation(SourceLocation location)
Sets the source location.
|
TemplateNodeBuilder |
setSoyDoc(String soyDoc,
SourceLocation soyDocLocation)
Sets the SoyDoc for the node to be built.
|
protected void |
setTemplateNames(String templateName,
String partialTemplateName) |
protected final TemplateNode.SoyFileHeaderInfo soyFileHeaderInfo
protected final ErrorReporter errorReporter
protected Integer id
@Nullable protected SyntaxVersionUpperBound syntaxVersionBound
protected String cmdText
protected Visibility visibility
protected String soyDoc
protected String soyDocDesc
@Nullable protected com.google.common.collect.ImmutableList<TemplateParam> params
protected boolean isMarkedV1
protected boolean strictHtmlDisabled
protected static final com.google.common.collect.ImmutableSet<String> COMMON_ATTRIBUTE_NAMES
protected TemplateNodeBuilder(TemplateNode.SoyFileHeaderInfo soyFileHeaderInfo, ErrorReporter errorReporter)
soyFileHeaderInfo - Info from the containing Soy file's header declarations.public TemplateNodeBuilder setId(int id)
public TemplateNodeBuilder setSourceLocation(SourceLocation location)
public abstract TemplateNodeBuilder setCommandValues(Identifier name, List<CommandTagAttribute> attrs)
name - The template nameattrs - The attributes that are set on the tag {e.g. kind="strict"}protected void setCommonCommandValues(List<CommandTagAttribute> attrs)
public TemplateNodeBuilder setSoyDoc(String soyDoc, SourceLocation soyDocLocation)
public TemplateNodeBuilder addParams(Iterable<? extends TemplateParam> newParams)
setSoyDoc() and setHeaderDecls(). This method is intended to be
called at most once for SoyDoc params and at most once for header params.params - The params to add.public abstract TemplateNode build()
protected final void markDeprecatedV1(boolean isDeprecatedV1)
protected void setAutoescapeInfo(AutoescapeMode autoescapeMode, @Nullable SanitizedContentKind contentKind, @Nullable SourceLocation kindLocation)
protected AutoescapeMode getAutoescapeMode()
@Nullable public SanitizedContentKind getContentKind()
protected com.google.common.collect.ImmutableList<String> getRequiredCssNamespaces()
protected void setRequiredCssNamespaces(com.google.common.collect.ImmutableList<String> requiredCssNamespaces)
protected String getCssBaseNamespace()
protected void setCssBaseNamespace(String cssBaseNamespace)
protected final void setTemplateNames(String templateName, @Nullable String partialTemplateName)
protected boolean getStrictHtmlDisabled()
protected String getTemplateName()