1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 package javax.enterprise.inject.spi; 20 21 import java.lang.annotation.Annotation; 22 import java.lang.reflect.Constructor; 23 import java.lang.reflect.Field; 24 import java.lang.reflect.Member; 25 import java.lang.reflect.Method; 26 import java.lang.reflect.Type; 27 import java.util.Set; 28 29 /** 30 * An InjectionPoint object provides metadata information about an injection point. 31 * An instance of InjectionPoint may represent one of the following types: 32 * <ul> 33 * <li>an injected field</li> 34 * <li>a parameter of a bean constructor</li> 35 * <li>an initializer method</li> 36 * <li>a producer method</li> 37 * <li>a disposer method</li> 38 * <li>an observer method</li> 39 * </ul> 40 * 41 * @version $Rev$ $Date$ 42 */ 43 public interface InjectionPoint 44 { 45 /** 46 * Returns required type of the injection point. 47 * 48 * @return type of the injection point 49 */ 50 public Type getType(); 51 52 /** 53 * Returns required qualifiers of the injection point. 54 * 55 * @return qualifiers at the injection point 56 */ 57 public Set<Annotation> getQualifiers(); 58 59 /** 60 * Returns the injection point owner bean. 61 * <p> 62 * If there is no bean for the injection point, 63 * it returns null. 64 * </p> 65 * 66 * @return injection point owner bean 67 */ 68 public Bean<?> getBean(); 69 70 /** 71 * Returns appered point for injection point. One of 72 * <ul> 73 * <li>{@link Field} object</li> 74 * <li>{@link Constructor} parameter</li> 75 * <li>{@link Method} producer method parameter</li> 76 * <li>{@link Method} disposal method parameter</li> 77 * <li>{@link Method} observer method parameter</li> 78 * </ul> 79 * 80 * @return where the injection point is appeared 81 */ 82 public Member getMember(); 83 84 /** 85 * Returns annotated object representation of member. 86 * 87 * @return annotated 88 */ 89 public Annotated getAnnotated(); 90 91 /** 92 * Returns true if injection point is decorator delegate, 93 * false otherwise. 94 * 95 * @return true if injection point is decorator delegate 96 */ 97 public boolean isDelegate(); 98 99 /** 100 * Returns true if injection point is transient, 101 * false otherwise. 102 * 103 * @return true if injection point is transient 104 */ 105 public boolean isTransient(); 106 }