Interface IType

    • Field Detail

      • EMPTY_TYPE_ARRAY

        static final IType[] EMPTY_TYPE_ARRAY
      • EMPTY_ARRAY

        static final IType[] EMPTY_ARRAY
    • Method Detail

      • getName

        String getName()
        The fully qualified name of this intrinsic type.
      • getDisplayName

        String getDisplayName()
        The display name of this intrinsic type. Often this is simply the same as getName(), but in some cases a type may want to modify it's name for presentation to the user.
      • getRelativeName

        String getRelativeName()
        The relative or unqualified name. For a class this should be just the class name without the package name.
      • getNamespace

        String getNamespace()
        The namespace for this class. For a java class this will be the package, while for other types of intrinsic types it could be another logical name.
      • getTypeLoader

        ITypeLoader getTypeLoader()
        Returns the type loader responsible for loading this intrinsic type.
      • getSupertype

        IType getSupertype()
        Returns the type representing the supertype of this type. Returns null if this type has no supertype.
      • getEnclosingType

        IType getEnclosingType()
        Returns the type immediately enclosing this type. If this type is not enclosed, returns null.
      • getGenericType

        IType getGenericType()
        If this is a parameterized type, returns the generic type this type parameterizes. Otherwise, returns null.
      • isFinal

        boolean isFinal()
        True if this type cannot be extended.
      • isInterface

        boolean isInterface()
        Returns true if this type is an interface.
      • getFunctionalInterface

        default IFunctionType getFunctionalInterface()
      • isEnum

        boolean isEnum()
        Returns true if this type is an enumeration.
      • getInterfaces

        IType[] getInterfaces()
        Returns:
        If this is a class, returns a list of all the interfaces this type implements. Similarly, if this is an interface, returns a list of all the interfaces this type extends. In any case, returns an empty list if this type neither implements nor extends interfaces.
      • isParameterizedType

        boolean isParameterizedType()
        Returns true if this ia a Parameterized Type.

        Note a Parameterzied Type is not the same as a Generic Type. The difference is that a Parameterized Type is a concrete version of a Generic Type. For instance, the class ArrayList is a Generic Type, while the class ArrayList is a Parameterized Type of the the Generic Type ArrayList.

      • isGenericType

        boolean isGenericType()
        Returns true if this ia a Generic Type.
        See Also:
        isParameterizedType()
      • getGenericTypeVariables

        IGenericTypeVariable[] getGenericTypeVariables()
        Returns an array of GenericTypeVariables declared with this Generic Type. Otherwise, returns null if this is not a Generic Type.
      • getParameterizedType

        IType getParameterizedType​(IType... ofType)
        Assuming this intrinsic type is a Generic type, return the parameterized type associated with the given list of type parameters. If the type has not been created yet, creates the parameterized type. Successive calls to this method having identical parameter types must return the identical parameterized type.
        Parameters:
        ofType - The type parameters.
        Returns:
        The concrete type associated with the type parameters.
      • getTypeParameters

        IType[] getTypeParameters()
        If this is a parameterized type, returns the specific types used to create this type, null otherwies.
      • getAllTypesInHierarchy

        Set<? extends IType> getAllTypesInHierarchy()
        Returns a Set of all IIntrinsicTypes that this class is assignable from, including this class. This includes implemented interfaces and superclasses, recursively up the hieararchy. For array types, this will be a Set of all types that its component type is assignable from.
      • isArray

        boolean isArray()
        True if this is an array.
      • isPrimitive

        boolean isPrimitive()
        True if this type represents a primitive type e.g., Java int, char, etc.
      • getArrayType

        IType getArrayType()
        Make an array type from this type. E.g., String -> String[]
      • makeArrayInstance

        Object makeArrayInstance​(int iLength)
        Construct an array instance of specified length.
      • getArrayLength

        int getArrayLength​(Object array)
                    throws IllegalArgumentException
        Returns the length of the specified array object.
        Parameters:
        array - An array instance of this intrinsic type.
        Returns:
        The length of the array.
        Throws:
        IllegalArgumentException - If the object argument is not an array.
      • getComponentType

        IType getComponentType()
        If this is an array type, a type representing the component type of the array. Otherwise null.
      • isAssignableFrom

        boolean isAssignableFrom​(IType type)
        Determines if the type represented by this intrinsic type is either the same as, or is a super-type of the type represented by the specified type parameter.
      • isMutable

        boolean isMutable()
        Are intances of this type mutable? Note sometimes it's difficult to determine. For instance, java classes don't contain any information about mutability. In which case we always assume mutable, even when the underlying type may in fact be immutable. E.g., even though java.lang.String is not mutable, its corresponding JavaIntrinsicType will say it is.
        Returns:
        True if this type is mutable.
      • getTypeInfo

        ITypeInfo getTypeInfo()
        Get the type information for this intrinsic type.
        See Also:
        ITypeInfo
      • unloadTypeInfo

        void unloadTypeInfo()
        Unload or nullify any references to this IType's ITypeInfo.
      • isValid

        boolean isValid()
        Defines this type if it is not yet fully defined. For instance, if this type has source code associated with it, it must fully compile the source for it to be fully defined.
        Returns:
        true if this type is valid.
      • getModifiers

        int getModifiers()
        Returns the modifiers for this type, encoded in an integer. The modifiers consist of the constants for public, protected, private, final, static, abstract they should be decoded using the methods of class Modifier.
        See Also:
        Modifier
      • isAbstract

        boolean isAbstract()
      • isDiscarded

        boolean isDiscarded()
        True if this type has been replaced with a newer version of the same name in the type system.
      • setDiscarded

        void setDiscarded​(boolean bDiscarded)
      • isCompoundType

        boolean isCompoundType()
      • getCompoundTypeComponents

        Set<IType> getCompoundTypeComponents()
      • getLiteralMetaType

        IMetaType getLiteralMetaType()
      • getSourceFiles

        default IFile[] getSourceFiles()
      • isDynamic

        default boolean isDynamic()
      • isCompilable

        default boolean isCompilable()
      • compile

        default byte[] compile()