Class HintedExpression
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.expressions.Expression
-
- net.ssehub.easy.instantiation.core.model.templateModel.HintedExpression
-
public class HintedExpression extends Expression
Wraps an expression with a formatting hint.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private Expressionexpressionprivate java.lang.Stringhint
-
Constructor Summary
Constructors Constructor Description HintedExpression(Expression expression, java.lang.String hint)Creates a hinted expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectaccept(IExpressionVisitor visitor)Visits the expression.java.lang.StringgetFormattingHint()Returns the formatting hint assigned to this expression.TypeDescriptor<?>inferType()Infers the type of this expression including the type of the contained sub-expressions.booleanreplaceEmptyLine()In content replacement, replace an entire line if this expression is evaluated to an empty string.
-
-
-
Field Detail
-
expression
private Expression expression
-
hint
private java.lang.String hint
-
-
Constructor Detail
-
HintedExpression
public HintedExpression(Expression expression, java.lang.String hint)
Creates a hinted expression.- Parameters:
expression- the expressionhint- the formatting hint
-
-
Method Detail
-
inferType
public TypeDescriptor<?> inferType() throws VilException
Description copied from class:ExpressionInfers the type of this expression including the type of the contained sub-expressions.- Specified by:
inferTypein classExpression- Returns:
- the type of this expression
- Throws:
VilException- in case that inferring the type fails
-
accept
public java.lang.Object accept(IExpressionVisitor visitor) throws VilException
Description copied from class:ExpressionVisits the expression.- Specified by:
acceptin classExpression- Parameters:
visitor- the visitor- Returns:
- the result of visiting this expression (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
replaceEmptyLine
public boolean replaceEmptyLine()
Description copied from class:ExpressionIn content replacement, replace an entire line if this expression is evaluated to an empty string.- Overrides:
replaceEmptyLinein classExpression- Returns:
truefor replace entire line,false(default) else
-
getFormattingHint
public java.lang.String getFormattingHint()
Description copied from class:ExpressionReturns the formatting hint assigned to this expression.- Overrides:
getFormattingHintin classExpression- Returns:
- the formatting hint, null for none
-
-