title: Kotlin Annotation Reflection to inject an argument to a function with a custom annotation
body: <p>I'd love to create a new library for my purposes and am currently struggling with the technical approach needed to fulfill the requirements.</p>
  <p>I want to have something like this:</p>
  <pre><code>class MyFoo {
    @Populate(&quot;myText&quot;)
    fun giveMeAValue(bar: Bar) {
      LOG.info(bar.message) // &quot;myText&quot;
    }
  }
  </code></pre>
  <p>I'd like to hook on the function call of <code>giveMeAValue</code> or better said I want to hook logic on every function that is annotated with <code>@Populate</code>. If a call is being registered I'd like to execute some logic and pass a value for the <code>bar</code> parameter. <em>Please ignore the fact that I might overwrite a value that has been passed already</em>.</p>
  <p>I was reading up for Reflection using Kotling (i.e. <a href="https://medium.com/tompee/kotlin-annotation-processor-and-code-generation-58bd7d0d333b" rel="nofollow noreferrer">https://medium.com/tompee/kotlin-annotation-processor-and-code-generation-58bd7d0d333b</a>) but could not find the thing I'd like to have here.</p>
  <p>The hooking/proxy mechanism before the &quot;real&quot; function is being called. That's what I want to achieve.</p>
  <p>Can anybody tell me what I am actually looking for? Is there a word for that concept or an article/guide describing this? I was not able to find anything. A code snippet/example would be awesome, too!</p>