1 /* 2 * Copyright 2002-2007 the original author or authors. 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 org.springframework.beans.factory.config; 18 19 import org.springframework.beans.BeansException; 20 21 /** 22 * Extension of the {@link InstantiationAwareBeanPostProcessor} interface, 23 * adding a callback for predicting the eventual type of a processed bean. 24 * 25 * <p><b>NOTE:</b> This interface is a special purpose interface, mainly for 26 * internal use within the framework. In general, application-provided 27 * post-processors should simply implement the plain 28 * {@link InstantiationAwareBeanPostProcessor} interface or derive from 29 * the {@link InstantiationAwareBeanPostProcessorAdapter} class. 30 * New methods might be added to this interface even in point releases. 31 * 32 * @author Juergen Hoeller 33 * @since 2.0.3 34 */ 35 public interface SmartInstantiationAwareBeanPostProcessor extends InstantiationAwareBeanPostProcessor { 36 37 /** 38 * Predict the type of the bean to be eventually returned from this 39 * processor's {@link #postProcessBeforeInstantiation} callback. 40 * @param beanClass the raw class of the bean 41 * @param beanName the name of the bean 42 * @return the type of the bean, or <code>null</code> if not predictable 43 * @throws org.springframework.beans.BeansException in case of errors 44 */ 45 Class predictBeanType(Class beanClass, String beanName) throws BeansException; 46 47 } 48