Interface IMetaOperation

    • Method Detail

      • getName

        java.lang.String getName()
        Returns the name of the method.
        Returns:
        the name of the method
      • isStatic

        boolean isStatic()
        Returns whether this operation is static.
        Returns:
        true if it is static, false else
      • isFirstParameterOperand

        boolean isFirstParameterOperand()
        Returns whether the first parameter is the operand.
        Returns:
        true if the first parameter is the operand, false else
      • getParameterCount

        int getParameterCount()
        Returns the number of parameters.
        Returns:
        the number of parameter
      • getRequiredParameterCount

        int getRequiredParameterCount()
        Returns the number of required parameters, i.e., non-default and non-named parameters.
        Returns:
        the number of required parameters
      • getParameter

        IMetaParameterDeclaration getParameter​(java.lang.String name)
        Returns a named parameter declaration.
        Parameters:
        name - the name of the parameter
        Returns:
        the declaration or null if there is none
      • getParameterType

        IMetaType getParameterType​(int index)
        Returns the specified parameter type.
        Parameters:
        index - the index of the parameter to return
        Returns:
        the specified parameter type
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0 || index >= getParameterCount()
      • getJavaSignature

        java.lang.String getJavaSignature()
        Returns the java-like signature of this operation.
        Returns:
        the java-like Java signature of this operation
      • getSignature

        java.lang.String getSignature()
        Returns the signature of the method (in terms of VIL types where possible).
        Returns:
        the signature of the method
      • getReturnType

        IMetaType getReturnType()
        Returns the return type of this operation.
        Returns:
        the return type
      • acceptsNamedParameters

        boolean acceptsNamedParameters()
        Returns whether the operation accepts named parameters.
        Returns:
        true if it accepts named parameters, false else
      • getDeclaringType

        IMetaType getDeclaringType()
        Returns the declaring type.
        Returns:
        the declaring type (may be null in case of a wrapped external Java method)
      • isPlaceholder

        boolean isPlaceholder()
        Returns whether this operation is valid or whether it is a placeholder operation in case that the original operation cannot be resolved but the script shall remain executable.
        Returns:
        true if this operation is a placeholder, false else
      • isConstructor

        boolean isConstructor()
        Returns whether this operation represents a constructor. Basically, for VIL a constructor is a public static method named "create" which returns an instance of the underlying type. Declared constructors are used for internal purposes.
        Returns:
        true if this operation is a "constructor", false else
      • isCompatible

        IMetaOperation.CompatibilityResult isCompatible​(java.lang.Class<?> retType,
                                                        java.lang.Object... params)
        Returns whether the operation represented by this instance is compatible to the given return type and parameters. This method does not consider possible unnamed parameter rather than the underlying Java parameter.
        Parameters:
        retType - the return type (may be null in order to ignore this parameter)
        params - the parameters (may be null if there are none, may be classes)
        Returns:
        an instance of IMetaOperation.CompatibilityResult denoting the actual compatibility level
      • invoke

        java.lang.Object invoke​(java.lang.Object... args)
                         throws VilException
        Invokes the specified operation. This method does not consider possible unnamed parameter rather than the underlying Java parameter. In case of acceptsNamedParameters() the caller must ensure that the last parameter is a map<String, Object> containing the named parameters.
        Parameters:
        args - the arguments, in case of non-static operations the first argument must be the object to execute on
        Returns:
        the result of the execution
        Throws:
        VilException - if the invocation fails
        See Also:
        isCompatible(java.lang.Class<?>, java.lang.Object...)