Class TypePool.Default.LazyTypeDescription.LazyAnnotationDescription

    • Field Detail

      • typePool

        protected final TypePool typePool
        The type pool for looking up type references.
      • annotationType

        private final TypeDescription annotationType
        The type of this annotation.
      • values

        protected final java.util.Map<java.lang.String,​AnnotationValue<?,​?>> values
        A map of annotation values by their property name.
    • Constructor Detail

      • LazyAnnotationDescription

        private LazyAnnotationDescription​(TypePool typePool,
                                          TypeDescription annotationType,
                                          java.util.Map<java.lang.String,​AnnotationValue<?,​?>> values)
        Creates a new lazy annotation description.
        Parameters:
        typePool - The type pool to be used for looking up linked types.
        annotationType - The annotation's type.
        values - A map of annotation value names to their value representations.
    • Method Detail

      • asListOfNullable

        protected static AnnotationList asListOfNullable​(TypePool typePool,
                                                         java.util.List<? extends TypePool.Default.LazyTypeDescription.AnnotationToken> tokens)
        Represents a list of annotation tokens in form of a list of lazy type annotations. Any annotation with a type that cannot be loaded from the type pool is ignored and not included in the list. If the provided tokens are null, an empty list is returned.
        Parameters:
        typePool - The type pool to be used for looking up linked types.
        tokens - The tokens to represent in the list.
        Returns:
        A list of the loadable annotations.
      • asList

        protected static AnnotationList asList​(TypePool typePool,
                                               java.util.List<? extends TypePool.Default.LazyTypeDescription.AnnotationToken> tokens)
        Represents a list of annotation tokens in form of a list of lazy type annotations. Any annotation with a type that cannot be loaded from the type pool is ignored and not included in the list.
        Parameters:
        typePool - The type pool to be used for looking up linked types.
        tokens - The tokens to represent in the list.
        Returns:
        A list of the loadable annotations.
      • getValue

        public AnnotationValue<?,​?> getValue​(MethodDescription.InDefinedShape property)
        Returns the value of this annotation.
        Parameters:
        property - The property being accessed.
        Returns:
        The value for the supplied property.
      • getAnnotationType

        public TypeDescription getAnnotationType()
        Returns a description of the annotation type of this annotation.
        Returns:
        A description of the annotation type of this annotation.
      • prepare

        public <T extends java.lang.annotation.Annotation> TypePool.Default.LazyTypeDescription.LazyAnnotationDescription.Loadable<T> prepare​(java.lang.Class<T> annotationType)
        Links this annotation description to a given annotation type such that it can be loaded. This does not cause the values of this annotation to be loaded.
        Type Parameters:
        T - The type of the annotation.
        Parameters:
        annotationType - The loaded annotation type of this annotation description.
        Returns:
        A loadable version of this annotation description.