Package io.micronaut.inject.writer
Class AbstractClassWriterOutputVisitor
java.lang.Object
io.micronaut.inject.writer.AbstractClassWriterOutputVisitor
- All Implemented Interfaces:
ClassWriterOutputVisitor
- Direct Known Subclasses:
AnnotationProcessingOutputVisitor
,DirectoryClassWriterOutputVisitor
@Internal
public abstract class AbstractClassWriterOutputVisitor
extends Object
implements ClassWriterOutputVisitor
Abstract implementation of the
ClassWriterOutputVisitor
interface that deals with service descriptors in a
common way across Java and Groovy.- Since:
- 1.0
- Author:
- graemerocher
-
Constructor Summary
ModifierConstructorDescriptionCompatibility constructor.protected
AbstractClassWriterOutputVisitor
(boolean isWriteOnFinish) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
finish()
Finish writing and flush any service entries to disk.The META-INF/services entries to write.final void
visitServiceDescriptor
(String type, String classname) Allows adding a class that will be written to theMETA-INF/services
file under the given type and class name.void
Writes the service entries.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.inject.writer.ClassWriterOutputVisitor
visitClass, visitClass, visitClass, visitGeneratedFile, visitGeneratedFile, visitGeneratedSourceFile, visitMetaInfFile, visitMetaInfFile, visitServiceDescriptor, visitServiceDescriptor, visitServiceDescriptor
-
Constructor Details
-
AbstractClassWriterOutputVisitor
protected AbstractClassWriterOutputVisitor(boolean isWriteOnFinish) Default constructor.- Parameters:
isWriteOnFinish
- Is this the eclipse compiler
-
AbstractClassWriterOutputVisitor
public AbstractClassWriterOutputVisitor()Compatibility constructor.
-
-
Method Details
-
getServiceEntries
Description copied from interface:ClassWriterOutputVisitor
The META-INF/services entries to write.- Specified by:
getServiceEntries
in interfaceClassWriterOutputVisitor
- Returns:
- A map of service to class entries
-
visitServiceDescriptor
Description copied from interface:ClassWriterOutputVisitor
Allows adding a class that will be written to theMETA-INF/services
file under the given type and class name.- Specified by:
visitServiceDescriptor
in interfaceClassWriterOutputVisitor
- Parameters:
type
- the fully qualified service nameclassname
- the fully qualified classname
-
finish
public final void finish()Description copied from interface:ClassWriterOutputVisitor
Finish writing and flush any service entries to disk.- Specified by:
finish
in interfaceClassWriterOutputVisitor
-
writeServiceEntries
public void writeServiceEntries(Map<String, Set<String>> serviceEntries, Element... originatingElements) Writes the service entries.- Parameters:
serviceEntries
- The service entriesoriginatingElements
- The originating elements
-