A simple template visitor is .symbol.KSDefaultVisitor.įor sample implementations of the SymbolProcessorProvider and SymbolProcessor interfaces, see the following files in the sample project.Īfter writing your own processor, register your processor provider to the package by including its fully-qualified name in resources/META-INF/services/.processing.SymbolProcessorProvider.Ĭreate another module that contains a workload where you want to try out your processor. Use resolver.getSymbolsWithAnnotation() to get the symbols you want to process, given the fully-qualified name of an annotation.Ī common use case for KSP is to implement a customized visitor (interface .symbol.KSVisitor) for operating on symbols. Docking ports not giving option to undock Exactly as the title says. Your main logic should be in the SymbolProcessor.process() method. Pass dependencies that your processor needs (such as CodeGenerator, processor options) through the parameters of SymbolProcessorProvider.create(). Implement SymbolProcessorProvider.create() to create a SymbolProcessor. Your implementation of SymbolProcessorProvider will be loaded as a service to instantiate the SymbolProcessor you implement. You'll need to implement .processing.SymbolProcessor and .processing.SymbolProcessorProvider.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |