| Constructor and Description |
|---|
Builder(int id,
boolean isImplicit,
SourceLocation sourceLocation) |
| Modifier and Type | Method and Description |
|---|---|
PrintNode |
build(ErrorReporter unusedForNow)
Returns a new
PrintNode built from this builder's state. |
PrintNode.Builder |
exprText(String exprText) |
PrintNode.Builder |
exprUnion(ExprUnion exprUnion) |
PrintNode.Builder |
userSuppliedPlaceholderName(String userSuppliedPlaceholderName) |
public Builder(int id,
boolean isImplicit,
SourceLocation sourceLocation)
id - The node's id.isImplicit - Whether the command print is implicit.sourceLocation - The node's source location.public PrintNode.Builder exprText(String exprText)
exprText - The node's expression text.IllegalStateException - if exprText or exprUnion
has already been set.public PrintNode.Builder exprUnion(ExprUnion exprUnion)
exprUnion - The parsed expression for this print node.IllegalStateException - if exprText or exprUnion
has already been set.public PrintNode.Builder userSuppliedPlaceholderName(String userSuppliedPlaceholderName)
userSuppliedPlaceholderName - The user-supplied placeholder name.public PrintNode build(ErrorReporter unusedForNow)
PrintNode built from this builder's state.IllegalStateException - if neither exprText nor exprUnion
have been set.
TODO(user): Most node builders report syntax errors to the ErrorReporter
argument. This builder ignores the error reporter argument because print nodes have
special fallback logic for when
parsing of the user-supplied placeholder name fails. Such parsing failures should thus not
currently be reported as "errors". It seems possible and desirable to change Soy to consider
these to be errors, but it's not trivial, because it could break templates that currently
compile.