1 /** 2 * Copyright (C) 2006 Google Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.inject.internal; 18 19 import com.google.common.collect.ImmutableMap; 20 import com.google.inject.spi.InjectionPoint; 21 22 import java.lang.reflect.Constructor; 23 import java.lang.reflect.InvocationTargetException; 24 import java.lang.reflect.Method; 25 import java.util.List; 26 27 /** 28 * Proxies calls to a {@link java.lang.reflect.Constructor} for a class 29 * {@code T}. 30 * 31 * @author crazybob@google.com (Bob Lee) 32 */ 33 interface ConstructionProxy<T> { 34 35 /** 36 * Constructs an instance of {@code T} for the given arguments. 37 */ newInstance(Object... arguments)38 T newInstance(Object... arguments) throws InvocationTargetException; 39 40 /** 41 * Returns the injection point for this constructor. 42 */ getInjectionPoint()43 InjectionPoint getInjectionPoint(); 44 45 /** 46 * Returns the injected constructor. If the injected constructor is synthetic (such as generated 47 * code for method interception), the natural constructor is returned. 48 */ getConstructor()49 Constructor<T> getConstructor(); 50 51 /*if[AOP]*/ 52 /** 53 * Returns the interceptors applied to each method, in order of invocation. 54 */ getMethodInterceptors()55 ImmutableMap<Method, List<org.aopalliance.intercept.MethodInterceptor>> getMethodInterceptors(); 56 /*end[AOP]*/ 57 } 58