package Ġcom . j tran sc . plugin Ċ Ċ import Ġcom . j tran sc . ast .* Ċ import Ġcom . j tran sc . ast . dependency . Ast Dependency Analyzer Ċ import Ġcom . j tran sc . ast . tre esh aking . Tree Sh aking Api Ċ import Ġcom . j tran sc . gen . Target Name Ċ import Ġcom . j tran sc . injector . Injector Ċ Ċ abstract Ġclass ĠJ Tran sc Plugin Ġ{ Ċ ĉ open Ġval Ġpriority : ĠInt Ġ= Ġ 0 ĊĊ ĉ late init Ġvar Ġinjector : ĠInject or ; Ġprivate Ġset Ċ ĉ late init Ġvar Ġtarget Name : ĠTarget Name ; Ġprivate Ġset ĊĊ ĉ fun Ġinitialize ( injector : ĠInject or ) Ġ{ Ċĉ ĉ this . injector Ġ= Ġinjector Ċĉ ĉ this . target Name Ġ= Ġinjector . get () Ċ ĉ } ĊĊ ĉ open Ġfun ĠonStart Building ( program : ĠAst Program ): ĠUnit Ġ{ Ċ ĉ } ĊĊ ĉ open Ġfun Ġon After All Class Dis covered ( program : ĠAst Program ): ĠUnit Ġ{ Ċ ĉ } ĊĊ ĉ open Ġfun Ġon After Class Dis covered ( clazz : ĠAst Type . REF , Ġprogram : ĠAst Program ): ĠUnit Ġ{ Ċ ĉ } ĊĊ ĉ open Ġfun Ġprocess After Tree Sh aking ( program : ĠAst Program ): ĠUnit Ġ{ Ċ ĉ } ĊĊ ĉ open Ġfun Ġprocess Before Tree Sh aking ( program Base : ĠAst Program ): ĠUnit Ġ{ Ċ ĉ } ĊĊ ĉ open Ġfun Ġon Tree Sh aking Add Basic Class ( tree Sh aking : ĠTree Sh aking Api , Ġfq name : ĠF q Name , Ġold class : ĠAst Class , Ġnew class : ĠAst Class ): ĠUnit Ġ{ Ċ ĉ } ĊĊ ĉ open Ġfun Ġon Tree Sh aking AddField ( tree Sh aking Api : ĠTree Sh aking Api , Ġold field : ĠAst Field , Ġnew field : ĠAst Field ) Ġ{ Ċ ĉ } ĊĊ ĉ open Ġfun Ġon Tree Sh aking Add Method ( tree Sh aking Api : ĠTree Sh aking Api , Ġold method : ĠAst Method , Ġnew method : ĠAst Method ) Ġ{ Ċ ĉ } ĊĊ ĉ open Ġfun Ġon Static Init Handle MethodCall ( program : ĠAst Program , Ġast : ĠAst Expr . CALL _ BASE , Ġbody : ĠAst Body ?, Ġda : ĠAst Dependency Analyzer . Ast Dependency Analyzer Gen ) Ġ{ Ċ ĉ } ĊĊ ĉ open Ġfun Ġon After Applied Class Features ( program : ĠAst Program ) Ġ{ Ċ ĉ } ĊĊ ĉ open Ġfun Ġon After Applied Method Body Feature ( method : ĠAst Method , Ġtransformed Body : ĠAst Body ) Ġ{ Ċ ĉ } ĊĊ ĉ fun ĠTree Sh aking Api . add Method ( method Ref : ĠAst Method Ref ) Ġ= Ġadd Method ( method Ref , Ġthis . java Class . name ) Ċ ĉ fun ĠTree Sh aking Api . addClass Full ( fq name : ĠF q Name ) Ġ= Ġadd Full Class ( fq name , Ġthis . java Class . name ) Ċ } Ċ Ċ class ĠJ Tran sc Plugin Group ( val Ġplugins : ĠIterable < J Tran sc Plugin >) Ġ: ĠJ Tran sc Plugin () Ġ{ Ċ ĉ override Ġfun ĠonStart Building ( program : ĠAst Program ) Ġ{ Ċĉ ĉ for Ġ( plugin Ġin Ġplugins ) Ġplugin . onStart Building ( program ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġon After All Class Dis covered ( program : ĠAst Program ) Ġ{ Ċĉ ĉ for Ġ( plugin Ġin Ġplugins ) Ġplugin . on After All Class Dis covered ( program ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġon After Class Dis covered ( clazz : ĠAst Type . REF , Ġprogram : ĠAst Program ) Ġ{ Ċĉ ĉ for Ġ( plugin Ġin Ġplugins ) Ġplugin . on After Class Dis covered ( clazz , Ġprogram ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġprocess After Tree Sh aking ( program : ĠAst Program ) Ġ{ Ċĉ ĉ for Ġ( plugin Ġin Ġplugins ) Ġplugin . process After Tree Sh aking ( program ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġprocess Before Tree Sh aking ( program Base : ĠAst Program ) Ġ{ Ċĉ ĉ for Ġ( plugin Ġin Ġplugins ) Ġplugin . process Before Tree Sh aking ( program Base ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġon Tree Sh aking Add Basic Class ( tree Sh aking : ĠTree Sh aking Api , Ġfq name : ĠF q Name , Ġold class : ĠAst Class , Ġnew class : ĠAst Class ) Ġ{ Ċĉ ĉ for Ġ( plugin Ġin Ġplugins ) Ġplugin . on Tree Sh aking Add Basic Class ( tree Sh aking , Ġfq name , Ġold class , Ġnew class ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġon Tree Sh aking AddField ( tree Sh aking Api : ĠTree Sh aking Api , Ġold field : ĠAst Field , Ġnew field : ĠAst Field ) Ġ{ Ċĉ ĉ for Ġ( plugin Ġin Ġplugins ) Ġplugin . on Tree Sh aking AddField ( tree Sh aking Api , Ġold field , Ġnew field ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġon Tree Sh aking Add Method ( tree Sh aking Api : ĠTree Sh aking Api , Ġold method : ĠAst Method , Ġnew method : ĠAst Method ) Ġ{ Ċĉ ĉ for Ġ( plugin Ġin Ġplugins ) Ġplugin . on Tree Sh aking Add Method ( tree Sh aking Api , Ġold method , Ġnew method ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġon Static Init Handle MethodCall ( program : ĠAst Program , Ġast : ĠAst Expr . CALL _ BASE , Ġbody : ĠAst Body ?, Ġda : ĠAst Dependency Analyzer . Ast Dependency Analyzer Gen ) Ġ{ Ċĉ ĉ for Ġ( plugin Ġin Ġplugins ) Ġplugin . on Static Init Handle MethodCall ( program , Ġast , Ġbody , Ġda ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġon After Applied Class Features ( program : ĠAst Program ) Ġ{ Ċĉ ĉ for Ġ( plugin Ġin Ġplugins ) Ġplugin . on After Applied Class Features ( program ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġon After Applied Method Body Feature ( method : ĠAst Method , Ġtransformed Body : ĠAst Body ) Ġ{ Ċĉ ĉ for Ġ( plugin Ġin Ġplugins ) Ġplugin . on After Applied Method Body Feature ( method , Ġtransformed Body ) Ċ ĉ } Ċ } Ċ Ċ fun ĠIterable < J Tran sc Plugin >. to Group ( injector : ĠInject or ) Ġ= ĠJ Tran sc Plugin Group ( this ). apply Ġ{ Ċ ĉ initialize ( injector ) Ċ ĉ for Ġ( plugin Ġin Ġthis @ to Group ) Ġplugin . initialize ( injector ) Ċ }