public interface CodegenFiler
An abstraction for writing out source files and resource files.
 Always attempts to create a new file and replace its content (as it is impossible to update files in annotation processing).
- 
Method SummaryModifier and TypeMethodDescriptiondefault ManifestResourcemanifest()Manifest resource that is used to collect all manifest files to allow runtime discovery.default FilerResourceA text resource that can be updated in the output.default voidservices(TypeName generator, TypeName providerInterface, List<TypeName> providers, Object... originatingElements) Write aMETA-INF/servicesfile for a specific provider interface and implementation(s).default FilerTextResourcetextResource(String location, Object... originatingElements) A text resource that can be updated in the output.writeResource(byte[] resource, String location, Object... originatingElements) Write a resource file.writeSourceFile(ClassModel classModel, Object... originatingElements) Write a source file from itsClassModel.writeSourceFile(TypeName type, String content, Object... originatingElements) Write a source file using string content.
- 
Method Details- 
writeSourceFileWrite a source file from itsClassModel.- Parameters:
- classModel- class model to write out
- originatingElements- elements that caused this type to be generated (you can use- TypeInfoBlueprint.originatingElementValue())
- Returns:
- written path, we expect to always run on local file system
 
- 
writeSourceFileWrite a source file using string content.- Parameters:
- type- type of the file to generate
- content- source code to write
- originatingElements- elements that caused this type to be generated
- Returns:
- written path, we expect to always run on local file system
 
- 
writeResourceWrite a resource file.- Parameters:
- resource- bytes of the resource file
- location- location to write to in the classes output directory
- originatingElements- elements that caused this file to be generated
- Returns:
- written path, we expect to always run on local file system
 
- 
textResourceA text resource that can be updated in the output. Note that the resource can only be written once per processing round.- Parameters:
- location- location to read/write to in the classes output directory
- originatingElements- elements that caused this file to be generated
- Returns:
- the resource that can be used to update the file
 
- 
resourceA text resource that can be updated in the output. Note that the resource can only be written once per processing round.- Parameters:
- location- location to read/write to in the classes output directory
- originatingElements- elements that caused this file to be generated
- Returns:
- the resource that can be used to update the file
 
- 
manifestManifest resource that is used to collect all manifest files to allow runtime discovery.- Returns:
- manifest resource
 
- 
servicesdefault void services(TypeName generator, TypeName providerInterface, List<TypeName> providers, Object... originatingElements) Write aMETA-INF/servicesfile for a specific provider interface and implementation(s).- Parameters:
- generator- type of the generator (to mention in the generated code)
- providerInterface- type of the provider interface (and also name of the file to be generated)
- providers- list of provider implementations to add to the file
- originatingElements- elements that caused this type to be generated
 
 
-