Class TypePool.Default.LazyTypeDescription.LazyAnnotationDescription

java.lang.Object
net.bytebuddy.description.annotation.AnnotationDescription.AbstractBase
net.bytebuddy.pool.TypePool.Default.LazyTypeDescription.LazyAnnotationDescription
All Implemented Interfaces:
AnnotationDescription
Direct Known Subclasses:
TypePool.Default.LazyTypeDescription.LazyAnnotationDescription.Loadable
Enclosing class:
TypePool.Default.LazyTypeDescription

private static class TypePool.Default.LazyTypeDescription.LazyAnnotationDescription extends AnnotationDescription.AbstractBase
A lazy description of an annotation that looks up types from a type pool when required.
  • Field Details

    • 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 Map<String,AnnotationValue<?,?>> values
      A map of annotation values by their property name.
  • Constructor Details

    • LazyAnnotationDescription

      private LazyAnnotationDescription(TypePool typePool, TypeDescription annotationType, Map<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 Details

    • asListOfNullable

      protected static AnnotationList asListOfNullable(TypePool typePool, @MaybeNull 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, 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 represented annotations.
    • getValue

      public AnnotationValue<?,?> getValue(MethodDescription.InDefinedShape property)
      Returns a 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

      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.