public class InMemoryClassWriterOutputVisitor extends Object implements ClassWriterOutputVisitor
| Constructor and Description |
|---|
InMemoryClassWriterOutputVisitor(InMemoryByteCodeGroovyClassLoader classLoader) |
| Modifier and Type | Method and Description |
|---|---|
void |
finish()
Finish writing and flush any service entries to disk.
|
OutputStream |
visitClass(String classname,
Element... originatingElements)
Visits a new class and returns the output stream with which should be written the bytes of the class to be
generated.
|
Optional<GeneratedFile> |
visitGeneratedFile(String path)
Visit a file that will be generated within the generated sources directory.
|
Optional<GeneratedFile> |
visitMetaInfFile(String path,
Element... originatingElements)
Visit a file within the META-INF directory of the classes directory.
|
void |
visitServiceDescriptor(String type,
String classname)
Allows adding a class that will be written to the
META-INF/services file under the given type and class
name. |
void |
visitServiceDescriptor(String type,
String classname,
Element originatingElement)
Allows adding a class that will be written to the
META-INF/services file under the given type and class
name. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetServiceEntries, visitClass, visitClass, visitMetaInfFile, visitServiceDescriptor, visitServiceDescriptorpublic InMemoryClassWriterOutputVisitor(InMemoryByteCodeGroovyClassLoader classLoader)
classLoader - The in-memory classloaderpublic OutputStream visitClass(String classname, Element... originatingElements) throws IOException
ClassWriterOutputVisitor
Note that this method should only be called from a TypeElementVisitor.VisitorKind.AGGREGATING visitor from within the TypeElementVisitor.finish(io.micronaut.inject.visitor.VisitorContext) method. If the file
visitClass in interface ClassWriterOutputVisitorclassname - the fully qualified classnameoriginatingElements - The originating elementsIOException - if an error occurs creating the output streampublic final void visitServiceDescriptor(String type, String classname)
ClassWriterOutputVisitorMETA-INF/services file under the given type and class
name.visitServiceDescriptor in interface ClassWriterOutputVisitortype - the fully qualified service nameclassname - the fully qualified classnamepublic void visitServiceDescriptor(String type, String classname, Element originatingElement)
ClassWriterOutputVisitorMETA-INF/services file under the given type and class
name.visitServiceDescriptor in interface ClassWriterOutputVisitortype - the fully qualified service nameclassname - the fully qualified classnameoriginatingElement - The originating elementpublic Optional<GeneratedFile> visitMetaInfFile(String path, Element... originatingElements)
ClassWriterOutputVisitorvisitMetaInfFile in interface ClassWriterOutputVisitorpath - The path to the fileoriginatingElements - The originating elementspublic Optional<GeneratedFile> visitGeneratedFile(String path)
ClassWriterOutputVisitorvisitGeneratedFile in interface ClassWriterOutputVisitorpath - The pathpublic void finish()
ClassWriterOutputVisitorfinish in interface ClassWriterOutputVisitor