Class AbstractAnnotationMetadataWriter

java.lang.Object
io.micronaut.inject.writer.AbstractClassFileWriter
io.micronaut.inject.writer.AbstractAnnotationMetadataWriter
All Implemented Interfaces:
ClassOutputWriter, OriginatingElements, org.objectweb.asm.Opcodes
Direct Known Subclasses:
BeanConfigurationWriter, BeanDefinitionReferenceWriter

@Internal public abstract class AbstractAnnotationMetadataWriter extends AbstractClassFileWriter
Base class for types that also write AnnotationMetadata.
Since:
1.0
Author:
Graeme Rocher
  • Field Details

    • FIELD_ANNOTATION_METADATA

      public static final String FIELD_ANNOTATION_METADATA
      Field name for annotation metadata.
      See Also:
    • FIELD_EMPTY_METADATA

      public static final String FIELD_EMPTY_METADATA
      Field name for empty metadata.
      See Also:
    • targetClassType

      protected final org.objectweb.asm.Type targetClassType
    • annotationMetadata

      protected final AnnotationMetadata annotationMetadata
    • loadTypeMethods

      protected final Map<String,org.objectweb.asm.commons.GeneratorAdapter> loadTypeMethods
    • defaults

      protected final Map<String,Integer> defaults
    • evaluatedExpressionProcessor

      protected final EvaluatedExpressionProcessor evaluatedExpressionProcessor
  • Constructor Details

    • AbstractAnnotationMetadataWriter

      protected AbstractAnnotationMetadataWriter(String className, OriginatingElements originatingElements, AnnotationMetadata annotationMetadata, boolean writeAnnotationDefaults, VisitorContext visitorContext)
      Parameters:
      className - The class name
      originatingElements - The originating elements
      annotationMetadata - The annotation metadata
      writeAnnotationDefaults - Whether to write annotation defaults
      visitorContext - The visitor context
    • AbstractAnnotationMetadataWriter

      protected AbstractAnnotationMetadataWriter(String className, Element originatingElement, AnnotationMetadata annotationMetadata, boolean writeAnnotationDefaults, VisitorContext visitorContext)
      Parameters:
      className - The class name
      originatingElement - The originating element
      annotationMetadata - The annotation metadata
      writeAnnotationDefaults - Whether to write annotation defaults
      visitorContext - The visitor context
  • Method Details

    • writeGetAnnotationMetadataMethod

      protected void writeGetAnnotationMetadataMethod(org.objectweb.asm.ClassWriter classWriter)
      Parameters:
      classWriter - The ClassWriter
    • beginAnnotationMetadataMethod

      @NonNull protected @NonNull org.objectweb.asm.commons.GeneratorAdapter beginAnnotationMetadataMethod(org.objectweb.asm.ClassWriter classWriter)
      Returns the generator adaptor for the method that resolves the annotation metadata.
      Parameters:
      classWriter - The class writer
      Returns:
      The generator adapter
    • writeAnnotationMetadataStaticInitializer

      protected void writeAnnotationMetadataStaticInitializer(org.objectweb.asm.ClassWriter classWriter)
      Parameters:
      classWriter - The ClassWriter
    • writeAnnotationMetadataStaticInitializer

      protected void writeAnnotationMetadataStaticInitializer(org.objectweb.asm.ClassWriter classWriter, Map<String,Integer> defaults)
      Parameters:
      classWriter - The ClassWriter
      defaults - The annotation defaults
    • initializeAnnotationMetadata

      protected void initializeAnnotationMetadata(org.objectweb.asm.commons.GeneratorAdapter staticInit, org.objectweb.asm.ClassWriter classWriter, Map<String,Integer> defaults)
      Parameters:
      staticInit - The GeneratorAdapter
      classWriter - The ClassWriter
      defaults - The annotation defaults