Class TypeDescription.SuperTypeLoading

    • Constructor Detail

      • SuperTypeLoading

        public SuperTypeLoading​(TypeDescription delegate,
                                java.lang.ClassLoader classLoader)
        Creates a super type loading type description.
        Parameters:
        delegate - The delegate type description.
        classLoader - The class loader to use for loading a super type.
      • SuperTypeLoading

        public SuperTypeLoading​(TypeDescription delegate,
                                java.lang.ClassLoader classLoader,
                                TypeDescription.SuperTypeLoading.ClassLoadingDelegate classLoadingDelegate)
        Creates a super type loading type description.
        Parameters:
        delegate - The delegate type description.
        classLoader - The class loader to use for loading a super type.
        classLoadingDelegate - A delegate for loading a type.
    • Method Detail

      • getDeclaredAnnotations

        public AnnotationList getDeclaredAnnotations()
        Returns a list of annotations that are declared by this instance.
        Returns:
        A list of declared annotations.
      • getModifiers

        public int getModifiers()
        Returns the modifier that is described by this object.
        Returns:
        The modifier that is described by this object.
      • getTypeVariables

        public TypeList.Generic getTypeVariables()
        Returns the type variables that are declared by this element.
        Returns:
        The type variables that are declared by this element.
      • getDescriptor

        public java.lang.String getDescriptor()
        Returns the descriptor of this byte code element.
        Returns:
        The descriptor of this byte code element.
      • getName

        public java.lang.String getName()
        Returns the internalName of this byte code element.
        Returns:
        The internalName of this byte code element as visible from within a running Java application.
      • getStackSize

        public StackSize getStackSize()
        Returns the size of the type described by this instance. Wildcard types (TypeDefinition.Sort.WILDCARD do not have a well-defined a stack size and cause an IllegalStateException to be thrown.
        Returns:
        The size of the type described by this instance.
      • isArray

        public boolean isArray()
        Checks if the type described by this entity is an array.
        Returns:
        true if this type description represents an array.
      • isPrimitive

        public boolean isPrimitive()
        Checks if the type described by this entity is a primitive type.
        Returns:
        true if this type description represents a primitive type.
      • getDeclaringType

        public TypeDescription getDeclaringType()
        Returns the declaring type of this instance.
        Returns:
        The declaring type or null if no such type exists.
      • getDeclaredTypes

        public TypeList getDeclaredTypes()
        Returns a list of types that are declared by this type. This list does not normally include anonymous types but might include additional types if they are explicitly added to an instrumented type.
        Returns:
        A list of types that are declared within this type.
      • getEnclosingMethod

        public MethodDescription.InDefinedShape getEnclosingMethod()
        Returns a description of the method that encloses this type. If this method is not enclosed by any type or is enclosed by the type initializer, null is returned by this method.
        Returns:
        A description of the enclosing method of this type or null if there is no such method.
      • getEnclosingType

        public TypeDescription getEnclosingType()
        Returns a description of this type's enclosing type if any.
        Returns:
        A description of the enclosing type of this type or null if there is no such type.
      • getSimpleName

        public java.lang.String getSimpleName()
        Returns the simple internalName of this type.
        Returns:
        The simple internalName of this type.
      • getCanonicalName

        public java.lang.String getCanonicalName()
        Returns the canonical name of this type if it exists.
        Returns:
        The canonical name of this type. Might be null.
      • isAnonymousType

        public boolean isAnonymousType()
        Checks if this type description represents an anonymous type.
        Returns:
        true if this type description represents an anonymous type.
      • isLocalType

        public boolean isLocalType()
        Checks if this type description represents a local type.
        Returns:
        true if this type description represents a local type.
      • getPackage

        public PackageDescription getPackage()
        Returns the package of the type described by this instance or null if the described type does not imply a package.
        Returns:
        The package of the type described by this instance or null if the described type does not imply a package.
      • getNestHost

        public TypeDescription getNestHost()
        Returns the nest host of this type. For types prior to Java 11, this type is returned which is the default nest host.
        Returns:
        The nest host of this type.
      • getNestMembers

        public TypeList getNestMembers()
        Returns a list of members that are part of a nesting group. Prior to Java 11, a list that only contains this type is returned which is the default nest group.
        Returns:
        A list of members of this nest group.
      • getRecordComponents

        public RecordComponentList<RecordComponentDescription.InDefinedShape> getRecordComponents()
        Returns the list of record components that are declared by this type. If this type is not a record, the returned list is empty.
        Returns:
        A list of record components that this type declares.
      • isRecord

        public boolean isRecord()
        Checks if this type is a Java record.
        Returns:
        true if this type is a Java record.
      • getPermittedSubclasses

        public TypeList getPermittedSubclasses()
        Returns the list of permitted subclasses if this class is a sealed class or an empty list if this class is not sealed.
        Returns:
        The list of permitted subclasses if this class is a sealed class or an empty list if this class is not sealed.