title: How to use CDI for method parameter injection?
body: <p>Is it possible to use CDI to inject parameters into method calls? The expected behaviour would be similar to field injection. The preferred producer is looked up and the product is used. </p>
  
  <p>What I would like to do is this:</p>
  
  <pre><code>public void foo(@Inject Bar bar){
    //do stuff
  } 
  </code></pre>
  
  <p>or this (with less confusing sytax):</p>
  
  <pre><code>public void foo(){
    @Inject 
    Bar bar;
    //do stuff
  } 
  </code></pre>
  
  <p>This syntax is illegal in both cases. Is there an alternative? If no - would this be a bad idea for some reason if it were possible?</p>
  
  <p>Thank you</p>
  
  <p><strong>EDIT</strong> - I may have made my requirements not clear enough - I would like to be able to call the method directly, leaving the initialization of the <code>bar</code> variable to the container. Jörn Horstmann's and Perception's answer suggest that it is not possible. </p>