Class TypePool.Default.LazyTypeDescription

    • Field Detail

      • SUPER_CLASS_INDEX

        private static final int SUPER_CLASS_INDEX
        The index of a super class's type annotations.
        See Also:
        Constant Field Values
      • NO_TYPE

        private static final java.lang.String NO_TYPE
        Indicates that a type does not exist and does therefore not have a name.
      • typePool

        private final TypePool typePool
        The type pool to be used for looking up linked types.
      • actualModifiers

        private final int actualModifiers
        The actual modifiers of this type.
      • modifiers

        private final int modifiers
        The modifiers of this type.
      • name

        private final java.lang.String name
        The binary name of this type.
      • superClassDescriptor

        private final java.lang.String superClassDescriptor
        The type's super type's descriptor or null if this type does not define a super type.
      • genericSignature

        private final java.lang.String genericSignature
        The type's generic signature as found in the class file or null if the type is not generic.
      • interfaceTypeDescriptors

        private final java.util.List<java.lang.String> interfaceTypeDescriptors
        The descriptor of this type's interfaces.
      • declaringTypeName

        private final java.lang.String declaringTypeName
        The binary name of this type's declaring type or null if no such type exists.
      • declaredTypes

        private final java.util.List<java.lang.String> declaredTypes
        A list of descriptors representing the types that are declared by this type.
      • anonymousType

        private final boolean anonymousType
        true if this type is an anonymous type.
      • nestHost

        private final java.lang.String nestHost
        The binary name of the nest host or null if no nest host was specified.
      • nestMembers

        private final java.util.List<java.lang.String> nestMembers
        A list of binary names of all specified nest members.
      • superTypeAnnotationTokens

        private final java.util.Map<java.lang.Integer,​java.util.Map<java.lang.String,​java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> superTypeAnnotationTokens
        A mapping of type annotations for this type's super type and interface types by their indices.
      • typeVariableAnnotationTokens

        private final java.util.Map<java.lang.Integer,​java.util.Map<java.lang.String,​java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> typeVariableAnnotationTokens
        A mapping of type annotations of the type variables' type annotations by their indices.
      • typeVariableBoundsAnnotationTokens

        private final java.util.Map<java.lang.Integer,​java.util.Map<java.lang.Integer,​java.util.Map<java.lang.String,​java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> typeVariableBoundsAnnotationTokens
        A mapping of type annotations of the type variables' bounds' type annotations by their indices and each variable's index.
      • permittedSubclasses

        private final java.util.List<java.lang.String> permittedSubclasses
        A list of internal names of permitted subclasses.
    • Constructor Detail

      • LazyTypeDescription

        protected LazyTypeDescription​(TypePool typePool,
                                      int actualModifiers,
                                      int modifiers,
                                      java.lang.String name,
                                      java.lang.String superClassInternalName,
                                      java.lang.String[] interfaceInternalName,
                                      java.lang.String genericSignature,
                                      TypePool.Default.LazyTypeDescription.TypeContainment typeContainment,
                                      java.lang.String declaringTypeInternalName,
                                      java.util.List<java.lang.String> declaredTypes,
                                      boolean anonymousType,
                                      java.lang.String nestHostInternalName,
                                      java.util.List<java.lang.String> nestMemberInternalNames,
                                      java.util.Map<java.lang.Integer,​java.util.Map<java.lang.String,​java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> superTypeAnnotationTokens,
                                      java.util.Map<java.lang.Integer,​java.util.Map<java.lang.String,​java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> typeVariableAnnotationTokens,
                                      java.util.Map<java.lang.Integer,​java.util.Map<java.lang.Integer,​java.util.Map<java.lang.String,​java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> typeVariableBoundsAnnotationTokens,
                                      java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken> annotationTokens,
                                      java.util.List<TypePool.Default.LazyTypeDescription.FieldToken> fieldTokens,
                                      java.util.List<TypePool.Default.LazyTypeDescription.MethodToken> methodTokens,
                                      java.util.List<TypePool.Default.LazyTypeDescription.RecordComponentToken> recordComponentTokens,
                                      java.util.List<java.lang.String> permittedSubclasses)
        Creates a new lazy type description.
        Parameters:
        typePool - The type pool to be used for looking up linked types.
        actualModifiers - The actual modifiers of this type.
        modifiers - The modifiers of this type.
        name - The binary name of this type.
        superClassInternalName - The internal name of this type's super type or null if no such super type is defined.
        interfaceInternalName - An array of this type's interfaces or null if this type does not define any interfaces.
        genericSignature - The type's generic signature as found in the class file or null if the type is not generic.
        typeContainment - A definition of this type's containment within another type or method.
        declaringTypeInternalName - The internal name of this type's declaring type or null if no such type exists.
        declaredTypes - A list of descriptors representing the types that are declared by this type.
        anonymousType - true if this type is an anonymous type.
        nestHostInternalName - The internal name of the nest host or null if no nest host was specified.
        nestMemberInternalNames - A list of internal names of the nest members.
        superTypeAnnotationTokens - A mapping of type annotations for this type's super type and interface types by their indices.
        typeVariableAnnotationTokens - A mapping of type annotations of the type variables' type annotations by their indices.
        typeVariableBoundsAnnotationTokens - A mapping of type annotations of the type variables' bounds' type annotations by their indices and each variable's index.
        annotationTokens - A list of tokens that represent the annotations of this type.
        fieldTokens - A list of field tokens describing the field's of this type.
        methodTokens - A list of method tokens describing the method's of this type.
        recordComponentTokens - A list of record component tokens describing the record components of this type.
        permittedSubclasses - A list of internal names of permitted subclasses.
    • Method Detail

      • 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.
      • 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.
      • 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.
      • 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.
      • getDeclaringType

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

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

        public int getActualModifiers​(boolean superFlag)
        Returns the type's actual modifiers as present in the class file. For example, a type cannot be private. but it modifiers might reflect this property nevertheless if a class was defined as a private inner class. The returned modifiers take also into account if the type is marked as Deprecated. Anonymous classes that are enclosed in a static method or the type initializer are additionally marked as final as it is also done by the Java compiler.
        Specified by:
        getActualModifiers in interface TypeDescription
        Overrides:
        getActualModifiers in class TypeDescription.AbstractBase
        Parameters:
        superFlag - true if the modifier's super flag should be set.
        Returns:
        The type's actual modifiers.
      • 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.
      • getDeclaredAnnotations

        public AnnotationList getDeclaredAnnotations()
        Returns a list of annotations that are declared by this instance.
        Returns:
        A list of declared annotations.
      • 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.
      • 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.