title: Passing parameter while injecting and retrieving using InjectionPoint
body: <p>This is relevant to one asked in <a href="https://stackoverflow.com/questions/22994716/pass-parameter-to-instance-of-inject-bean">Pass Parameter to Instance of @Inject Bean</a></p>
  
  <p>but i need some different approach for my implemenation.</p>
  
  <p>For passing parameter while injecting, a custom qualifier can be created like :</p>
  
  <pre><code>@Qualifier
  @Target({ TYPE, METHOD, PARAMETER, FIELD })
  @Retention(RUNTIME)
  @Documented
  public @interface SendInject{
      @Nonbinding
      int value() default 0; // int value will be store here
  }
  </code></pre>
  
  <p>The class to be injected need to be annotated with <code>@SendInject</code> as:</p>
  
  <pre><code>@SendInject
  public class Receiver{
  
     int in;
  
     private int extractValue(InjectionPoint ip) {
          for (Annotation annotation : ip.getQualifiers()) {
              if (annotation.annotationType().equals(SendInject.class))
                  return ((SendInject) annotation).value();
         }
         throw new IllegalStateException("No @Initialized on InjectionPoint");
     }
  
     @Inject
     public Receiver(InjectionPoint ip) {
          this.in= extractValue(ip);
     }
     ..........
    }
  </code></pre>
  
  <p>And while injecting <code>Receiver</code> all the members needs to use the custom qualifier <code>@SendInject</code> . like:</p>
  
  <pre><code>  public class Sender{
  
        @Inject
        @SendInject(9)
        Receiver receiver;
     ..................
  
      }
  </code></pre>
  
  <p>I do not want to use <code>@SendInject</code> everytime i inject Receiver because its not necessary to pass parameter at few points for my implementation. Is there any way that i can customize the custom qualifier while injecting <code>Recevier</code> so that it can be used only when some parameter need to be passed?</p>
  
  <p>I tried doing it so, but getting <code>Ambiguous dependency error</code> while deploying my component.</p>