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... originatingElements)
Visits a new class and returns the output stream with which should be written the bytes of the class to be
generated.
|
default 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.
|
default java.util.Optional<GeneratedFile> |
visitMetaInfFile(java.lang.String path)
Deprecated.
Visiting a file should supply the originating elements. Use
visitMetaInfFile(String, Element...) instead |
java.util.Optional<GeneratedFile> |
visitMetaInfFile(java.lang.String path,
Element... originatingElements)
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
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
classname - the fully qualified classnamejava.io.IOException - if an error occurs creating the output streamdefault java.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 streamjava.io.OutputStream visitClass(java.lang.String classname,
Element... originatingElements)
throws java.io.IOException
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
classname - the fully qualified classnameoriginatingElements - The originating elementsjava.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 created@Deprecated default java.util.Optional<GeneratedFile> visitMetaInfFile(java.lang.String path)
visitMetaInfFile(String, Element...) insteadpath - The path to the filejava.io.IOException - If the file couldn't be createdjava.util.Optional<GeneratedFile> visitMetaInfFile(java.lang.String path, Element... originatingElements)
path - The path to the fileoriginatingElements - The originating elementsjava.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