Class VarModelIdentifierExpression
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.expressions.Expression
-
- net.ssehub.easy.instantiation.core.model.expressions.VarModelIdentifierExpression
-
public class VarModelIdentifierExpression extends Expression
Represents an identifier in a variability model. This expression does not need to carry resolved information as it will be resolved at runtime. It can carry an optional type to enable type-safe resolution of expresions.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringidentifierprivate ITypedModelmodelprivate TypeDescriptor<?>type
-
Constructor Summary
Constructors Constructor Description VarModelIdentifierExpression(java.lang.String identifier, TypeDescriptor<?> type, IModel model)Creates the representing instance.VarModelIdentifierExpression(java.lang.String identifier, TypeDescriptor<?> type, ITypedModel model)Creates the representing instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectaccept(IExpressionVisitor visitor)Visits the expression.java.lang.StringgetIdentifier()Returns the original identifier.ITypedModelgetModel()Returns the model.TypeDescriptor<?>getType()Returns the related type (without potential exception).TypeDescriptor<?>inferType()Infers the type of this expression including the type of the contained sub-expressions.booleanisMarkedAsResolved()Returns whethermarkAsResolved()was called on this instance.voidmarkAsResolved()Marks this identifier expression as resolved and not needed anymore!-
Methods inherited from class net.ssehub.easy.instantiation.core.model.expressions.Expression
replaceEmptyLine
-
-
-
-
Field Detail
-
identifier
private java.lang.String identifier
-
type
private TypeDescriptor<?> type
-
model
private ITypedModel model
-
-
Constructor Detail
-
VarModelIdentifierExpression
public VarModelIdentifierExpression(java.lang.String identifier, TypeDescriptor<?> type, IModel model)Creates the representing instance.- Parameters:
identifier- the identifier from VILtype- the related type (may be null if unknown/unresolved, thenIvmlElementis assumed)model- the model this expression was created for (for further resolution, may be null)
-
VarModelIdentifierExpression
public VarModelIdentifierExpression(java.lang.String identifier, TypeDescriptor<?> type, ITypedModel model)Creates the representing instance.- Parameters:
identifier- the identifier from VILtype- the related type (may be null if unknown/unresolved, thenIvmlElementis assumed)model- the model this expression was created for (for further resolution, may be null)
-
-
Method Detail
-
getModel
public ITypedModel getModel()
Returns the model.- Returns:
- the model, may be null
-
getIdentifier
public java.lang.String getIdentifier()
Returns the original identifier.- Returns:
- the original identifier
-
getType
public TypeDescriptor<?> getType()
Returns the related type (without potential exception).- Returns:
- the type of the represented variability model element (may be
IvmlElementif unknown/unresolved)
-
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)
-
markAsResolved
public void markAsResolved()
Marks this identifier expression as resolved and not needed anymore!
-
isMarkedAsResolved
public boolean isMarkedAsResolved()
Returns whethermarkAsResolved()was called on this instance.- Returns:
trueif resolved,falseelse
-
-