Class AnnotationMetadataWriter

    • Constructor Detail

      • AnnotationMetadataWriter

        @Deprecated
        public AnnotationMetadataWriter​(java.lang.String className,
                                        ClassElement originatingElement,
                                        io.micronaut.core.annotation.AnnotationMetadata annotationMetadata,
                                        boolean writeAnnotationDefaults)
        Deprecated.
        No longer needs to be instantiated directly, just use the static methods
        Constructs a new writer for the given class name and metadata.
        Parameters:
        className - The class name for which the metadata relates
        originatingElement - The originating element
        annotationMetadata - The annotation metadata
        writeAnnotationDefaults - Whether annotations defaults should be written
      • AnnotationMetadataWriter

        @Deprecated
        public AnnotationMetadataWriter​(java.lang.String className,
                                        ClassElement originatingElement,
                                        io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
        Deprecated.
        No longer needs to be instantiated directly, just use the static methods
        Constructs a new writer for the given class name and metadata.
        Parameters:
        className - The class name for which the metadata relates
        originatingElement - The originating element
        annotationMetadata - The annotation metadata
    • Method Detail

      • getClassName

        public java.lang.String getClassName()
        Returns:
        The class name that this metadata will generate
      • writeTo

        public void writeTo​(java.io.OutputStream outputStream)
        Write the class to the output stream, such a JavaFileObject created from a java annotation processor Filer object.
        Parameters:
        outputStream - the output stream pointing to the target class file
      • instantiateNewMetadata

        @Internal
        public static void instantiateNewMetadata​(org.objectweb.asm.Type owningType,
                                                  org.objectweb.asm.ClassWriter declaringClassWriter,
                                                  org.objectweb.asm.commons.GeneratorAdapter generatorAdapter,
                                                  DefaultAnnotationMetadata annotationMetadata,
                                                  java.util.Map<java.lang.String,​java.lang.Integer> defaultsStorage,
                                                  java.util.Map<java.lang.String,​org.objectweb.asm.commons.GeneratorAdapter> loadTypeMethods)
        Writes out the byte code necessary to instantiate the given DefaultAnnotationMetadata.
        Parameters:
        owningType - The owning type
        declaringClassWriter - The declaring class writer
        generatorAdapter - The generator adapter
        annotationMetadata - The annotation metadata
        defaultsStorage - The annotation defaults
        loadTypeMethods - The generated load type methods
      • instantiateNewMetadataHierarchy

        @Internal
        public static void instantiateNewMetadataHierarchy​(org.objectweb.asm.Type owningType,
                                                           org.objectweb.asm.ClassWriter classWriter,
                                                           org.objectweb.asm.commons.GeneratorAdapter generatorAdapter,
                                                           AnnotationMetadataHierarchy hierarchy,
                                                           java.util.Map<java.lang.String,​java.lang.Integer> defaultsStorage,
                                                           java.util.Map<java.lang.String,​org.objectweb.asm.commons.GeneratorAdapter> loadTypeMethods)
        Writes out the byte code necessary to instantiate the given AnnotationMetadataHierarchy.
        Parameters:
        owningType - The owning type
        classWriter - The declaring class writer
        generatorAdapter - The generator adapter
        hierarchy - The annotation metadata
        defaultsStorage - The annotation defaults
        loadTypeMethods - The generated load type methods
      • pushAnnotationMetadataReference

        @Internal
        public static void pushAnnotationMetadataReference​(org.objectweb.asm.commons.GeneratorAdapter generatorAdapter,
                                                           AnnotationMetadataReference annotationMetadata)
        Pushes an annotation metadata reference.
        Parameters:
        generatorAdapter - The generator adapter
        annotationMetadata - The metadata
      • writeAnnotationDefaults

        @Internal
        public static void writeAnnotationDefaults​(DefaultAnnotationMetadata annotationMetadata,
                                                   org.objectweb.asm.ClassWriter classWriter,
                                                   org.objectweb.asm.Type owningType,
                                                   java.util.Map<java.lang.String,​java.lang.Integer> defaultsStorage,
                                                   java.util.Map<java.lang.String,​org.objectweb.asm.commons.GeneratorAdapter> loadTypeMethods)
        Writes out the byte code necessary to instantiate the given DefaultAnnotationMetadata.
        Parameters:
        annotationMetadata - The annotation metadata
        classWriter - The class writer
        owningType - The owning type
        defaultsStorage - The annotation defaults
        loadTypeMethods - The generated load type methods
      • writeAnnotationDefaults

        @Internal
        public static void writeAnnotationDefaults​(org.objectweb.asm.Type owningType,
                                                   org.objectweb.asm.ClassWriter classWriter,
                                                   org.objectweb.asm.commons.GeneratorAdapter staticInit,
                                                   DefaultAnnotationMetadata annotationMetadata,
                                                   java.util.Map<java.lang.String,​java.lang.Integer> defaultsStorage,
                                                   java.util.Map<java.lang.String,​org.objectweb.asm.commons.GeneratorAdapter> loadTypeMethods)
        Write annotation defaults into the given static init block.
        Parameters:
        owningType - The owning type
        classWriter - The class writer
        staticInit - The staitc init
        annotationMetadata - The annotation metadata
        defaultsStorage - The annotation defaults
        loadTypeMethods - The load type methods