01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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 java.beans.PropertyDescriptor;
20: import java.lang.reflect.Constructor;
21:
22: import org.springframework.beans.BeansException;
23: import org.springframework.beans.PropertyValues;
24:
25: /**
26: * Adapter that implements all methods on {@link SmartInstantiationAwareBeanPostProcessor}
27: * as no-ops, which will not change normal processing of each bean instantiated
28: * by the container. Subclasses may override merely those methods that they are
29: * actually interested in.
30: *
31: * <p>Note that this base class is only recommendable if you actually require
32: * {@link InstantiationAwareBeanPostProcessor} functionality. If all you need
33: * is plain {@link BeanPostProcessor} functionality, prefer a straight
34: * implementation of that (simpler) interface.
35: *
36: * @author Rod Johnson
37: * @author Juergen Hoeller
38: * @since 2.0
39: */
40: public abstract class InstantiationAwareBeanPostProcessorAdapter
41: implements SmartInstantiationAwareBeanPostProcessor {
42:
43: public Class predictBeanType(Class beanClass, String beanName) {
44: return null;
45: }
46:
47: public Constructor[] determineCandidateConstructors(
48: Class beanClass, String beanName) throws BeansException {
49: return null;
50: }
51:
52: public Object postProcessBeforeInstantiation(Class beanClass,
53: String beanName) throws BeansException {
54: return null;
55: }
56:
57: public boolean postProcessAfterInstantiation(Object bean,
58: String beanName) throws BeansException {
59: return true;
60: }
61:
62: public PropertyValues postProcessPropertyValues(PropertyValues pvs,
63: PropertyDescriptor[] pds, Object bean, String beanName)
64: throws BeansException {
65:
66: return pvs;
67: }
68:
69: public Object postProcessBeforeInitialization(Object bean,
70: String beanName) throws BeansException {
71: return bean;
72: }
73:
74: public Object postProcessAfterInitialization(Object bean,
75: String beanName) throws BeansException {
76: return bean;
77: }
78:
79: }
|