Class 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
    • Constructor Detail

      • VarModelIdentifierExpression

        public VarModelIdentifierExpression​(java.lang.String identifier,
                                            TypeDescriptor<?> type,
                                            IModel model)
        Creates the representing instance.
        Parameters:
        identifier - the identifier from VIL
        type - the related type (may be null if unknown/unresolved, then IvmlElement is 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 VIL
        type - the related type (may be null if unknown/unresolved, then IvmlElement is 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 IvmlElement if unknown/unresolved)
      • inferType

        public TypeDescriptor<?> inferType()
                                    throws VilException
        Description copied from class: Expression
        Infers the type of this expression including the type of the contained sub-expressions.
        Specified by:
        inferType in class Expression
        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: Expression
        Visits the expression.
        Specified by:
        accept in class Expression
        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 whether markAsResolved() was called on this instance.
        Returns:
        true if resolved, false else