public final class ExprUnion extends Object
Important: Do not use outside of Soy code (treat as superpackage-private).
If this expression is in V2 syntax, then getExpr() will return a nonnull expression
tree. If this expression is in V1 syntax, then #getExpr() will return null. In either
case, the expression text can be obtained from getExprText().
| Constructor and Description |
|---|
ExprUnion(ExprNode expr)
Constructor for an instance that represents a V2 expression.
|
ExprUnion(ExprRootNode expr)
Constructor for an instance that represents a V2 expression.
|
| Modifier and Type | Method and Description |
|---|---|
ExprUnion |
copy(CopyState copyState)
Returns a (deep) clone of this object.
|
static List<ExprUnion> |
createList(List<? extends ExprRootNode> exprs)
Utility to create a list of
ExprUnions from a list of expression trees. |
ExprRootNode |
getExpr()
Returns the expression tree if the expression is in V2 syntax, else null.
|
String |
getExprText()
Returns the expression text.
|
void |
reportV2ParseErrors(ErrorReporter reporter)
Adds all the errors from trying to parse this as a V2 expression to the given error reporter.
|
public ExprUnion(ExprNode expr)
expr - The expression tree.public ExprUnion(ExprRootNode expr)
expr - The expression tree.public static List<ExprUnion> createList(List<? extends ExprRootNode> exprs)
ExprUnions from a list of expression trees.exprs - The list of expression trees.ExprUnions.public ExprRootNode getExpr()
public String getExprText()
public void reportV2ParseErrors(ErrorReporter reporter)
Guaranteed to add at least one error if getExpr() is null.