public interface ClassWriterOutputVisitor
Modifier and Type | Method and Description |
---|---|
void |
finish()
Finish writing and flush any service entries to disk.
|
default java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
getServiceEntries()
The META-INF/services entries to write.
|
default java.io.OutputStream |
visitClass(java.lang.String classname)
Visits a new class and returns the output stream with which should be written the bytes of the class to be
generated.
|
java.io.OutputStream |
visitClass(java.lang.String classname,
Element originatingElement)
Visits a new class and returns the output stream with which should be written the bytes of the class to be
generated.
|
java.util.Optional<GeneratedFile> |
visitGeneratedFile(java.lang.String path)
Visit a file that will be generated within the generated sources directory.
|
java.util.Optional<GeneratedFile> |
visitMetaInfFile(java.lang.String path)
Visit a file within the META-INF directory of the classes directory.
|
default void |
visitServiceDescriptor(java.lang.Class type,
java.lang.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(java.lang.String type,
java.lang.String classname)
Allows adding a class that will be written to the
META-INF/services file under the given type and class
name. |
default java.io.OutputStream visitClass(java.lang.String classname) throws java.io.IOException
TypeElementVisitor.VisitorKind.AGGREGATING
visitor from within the TypeElementVisitor.finish(io.micronaut.inject.visitor.VisitorContext)
method. If the fileclassname
- the fully qualified classnamejava.io.IOException
- if an error occurs creating the output streamjava.io.OutputStream visitClass(java.lang.String classname, @Nullable Element originatingElement) throws java.io.IOException
classname
- the fully qualified classnameoriginatingElement
- The originating elementjava.io.IOException
- if an error occurs creating the output streamvoid visitServiceDescriptor(java.lang.String type, java.lang.String classname)
META-INF/services
file under the given type and class
name.type
- the fully qualified service nameclassname
- the fully qualified classnamejava.io.IOException
- If the file couldn't be createdjava.util.Optional<GeneratedFile> visitMetaInfFile(java.lang.String path)
path
- The path to the filejava.io.IOException
- If the file couldn't be createdjava.util.Optional<GeneratedFile> visitGeneratedFile(java.lang.String path)
path
- The pathvoid finish()
default java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getServiceEntries()
default void visitServiceDescriptor(java.lang.Class type, java.lang.String classname)
META-INF/services
file under the given type and class
name.type
- The service typeclassname
- the fully qualified classnamejava.io.IOException
- If the file couldn't be created