Package 

Interface SymbolProcessor


  • 
    public interface SymbolProcessor
    
                        

    SymbolProcessor is the interface used by plugins to integrate into Kotlin Symbol Processing. SymbolProcessor supports multiple round execution, a processor may return a list of deferred symbols at the end of every round, which will be passed to proceesors again in the next round, together with the newly generated symbols. Upon Exceptions, KSP will try to distinguish the exceptions from KSP and exceptions from processors. Exceptions will result in a termination of processing immediately and be logged as an error in KSPLogger. Exceptions from KSP should be reported to KSP developers for further investigation. At the end of the round where exceptions or errors happened, all processors will invoke onError() function to do their own error handling.

    • Method Summary

      Modifier and Type Method Description
      abstract List<KSAnnotated> process(Resolver resolver) Called by Kotlin Symbol Processing to run the processing task.
      Unit finish() Called by Kotlin Symbol Processing to finalize the processing of a compilation.
      Unit onError() Called by Kotlin Symbol Processing to handle errors after a round of processing.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • finish

         Unit finish()

        Called by Kotlin Symbol Processing to finalize the processing of a compilation.

      • onError

         Unit onError()

        Called by Kotlin Symbol Processing to handle errors after a round of processing.