Class ModelCallExpression<V extends IMetaParameterDeclaration,​M extends IResolvableModel<V,​M>,​O extends IResolvableOperation<V>>

    • Constructor Detail

      • ModelCallExpression

        protected ModelCallExpression()
        Constructor for serialization.
      • ModelCallExpression

        public ModelCallExpression​(M model,
                                   boolean isSuper,
                                   java.lang.String name,
                                   CallArgument... arguments)
                            throws VilException
        Creates a new model call expression.
        Parameters:
        model - the actual model to resolve the operation on
        isSuper - this is a super call
        name - the name of the operation
        arguments - the actual arguments
        Throws:
        VilException - in case of illegal (qualified) names
      • ModelCallExpression

        protected ModelCallExpression​(M model,
                                      O resolved,
                                      CallArgument... arguments)
                               throws VilException
        Creates a new model call expression for a known operation.
        Parameters:
        model - the actual model resolved belongs to
        resolved - the resolved operation
        arguments - the actual arguments
        Throws:
        VilException - in case of illegal (qualified) names
    • Method Detail

      • isSuper

        public boolean isSuper()
        Returns whether this call is a super script call.
        Returns:
        true if is a super script call, false else
      • getModel

        public M getModel()
        Returns the owning model.
        Returns:
        the owning model
      • setModel

        void setModel​(M model)
        Changes the owning model. Required, if a temporary model was used for resolution, e.g., in case of recursive calls.
        Parameters:
        model - the new model (null will be ignored)
      • getResolved

        public O getResolved()
        Returns the resolved operation. inferType() must be called before.
        Returns:
        the resolved operation or null if inferType() was not called before or the operation cannot be resolved
      • getOperationClass

        protected abstract java.lang.Class<? extends O> getOperationClass()
        Returns the actual operation class, i.e., the class of the operation.
        Returns:
        the operation class
      • 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
      • getInvalidOperationMessage

        protected java.lang.String getInvalidOperationMessage​(IMetaOperation op)
        Returns the message to be returned in case of an invalid operation.
        Parameters:
        op - the invalid operation
        Returns:
        the related message
      • isVisible

        public abstract boolean isVisible​(M fromModel)
        Returns whether the resolved model operation is visible.
        Parameters:
        fromModel - the model issuing the call
        Returns:
        true if the operation is visible, false else