Interface IMetaType

    • Method Detail

      • getName

        java.lang.String getName()
        Returns the (simple) name of this type.
        Returns:
        the simple name
      • getQualifiedName

        java.lang.String getQualifiedName()
        Returns the qualified name of this type.
        Returns:
        the qualified name
      • getOperationsCount

        int getOperationsCount()
        Returns the number of operations provided by this type.
        Returns:
        the number of operations
      • getOperation

        IMetaOperation getOperation​(int index)
        Returns the specified operation.
        Parameters:
        index - the 0-based index of the operation to be returned
        Returns:
        the specified operation
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0 || index>=getOperationsCount()
      • getGenericParameterCount

        int getGenericParameterCount()
        Returns the number of generic type parameters.
        Returns:
        the number of generic type parameters
      • getGenericParameterType

        TypeDescriptor<?> getGenericParameterType​(int index)
        Returns the specified generic parameter type.
        Parameters:
        index - the index of the parameter type to return
        Returns:
        the specified parameter type
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0 || index >= getGenericParameterCount()
      • getFieldCount

        int getFieldCount()
        Returns the number of fields provided by this type.
        Returns:
        the number of fields
      • getField

        IMetaField getField​(int index)
        Returns the specified field.
        Parameters:
        index - the 0-based index of the field to be returned
        Returns:
        the specified field
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0 || index>=getFieldCount()
      • isAssignableFrom

        boolean isAssignableFrom​(IMetaType type)
        Returns whether this type is the same or a super class of type.
        Parameters:
        type - the descriptor to be tested
        Returns:
        true if both types are assignment compatible, false else
      • findConversion

        IMetaOperation findConversion​(IMetaType sourceType,
                                      IMetaType targetType)
        Returns the conversion operation from this type to target type (if there is any).
        Parameters:
        sourceType - the source type to convert from
        targetType - the target type to convert to
        Returns:
        the conversion operation as defined in the underlying implementation class, null if no matching can be found
      • isBasicType

        boolean isBasicType()
        Returns whether this instance represents a basic type.
        Returns:
        true if this instance represents a basic type, false else
      • getTypeRegistry

        TypeRegistry getTypeRegistry()
        Returns the type registry this type was registered by.
        Returns:
        the type registry
      • enableDynamicDispatch

        boolean enableDynamicDispatch()
        Returns whether this type enables dynamic dispatch of operations.
        Returns:
        true if it enables dynamic dispatch, false else
      • isPlaceholder

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

        IMetaOperation addPlaceholderOperation​(java.lang.String name,
                                               int parameterCount,
                                               boolean acceptsNamedParameters)
        Adds a placeholder operation, i.e., in case that the original operation cannot be resolved but the script shall remain executable.
        Parameters:
        name - the name of the operation
        parameterCount - the number of parameters of the operation
        acceptsNamedParameters - whether the operation shall accept named parameters
        Returns:
        the added operation, null if this type is not a placeholder
      • isActualTypeOf

        boolean isActualTypeOf​(IMetaType type)
        Returns whether this type can act as an actual type of type.
        Parameters:
        type - the type to be checked
        Returns:
        true if this type can act as an actual type of type, false else
        See Also:
        IActualTypeProvider
      • getBaseType

        IMetaType getBaseType()
        Returns the base type (in case of IVML derived types).
        Returns:
        the base type or null
      • getSuperType

        IMetaType getSuperType()
        Returns the type this type is refined from.
        Returns:
        the super type or null if there is none
      • isInternal

        boolean isInternal()
        Returns whether this type is internal and shall not be visible to the user.
        Returns:
        true if this type is internal, false else
      • checkConversion

        boolean checkConversion​(IMetaType param,
                                IMetaOperation conversion)
        Checks a conversion from this type to param via the given conversion.
        Parameters:
        param - the original parameter value
        conversion - the conversion function
        Returns:
        true if ok, false else
      • getCandidates

        java.util.List<IMetaOperation> getCandidates​(java.lang.String name,
                                                     int unnamedArgsCount)
        Returns operation candidates matching the given name and number of unnamed (required) arguments.
        Parameters:
        name - the name of the operation
        unnamedArgsCount - the number of unnamed arguments
        Returns:
        the operation candidates