001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.xbean.spring.util;
018    
019    import org.springframework.beans.BeansException;
020    import org.springframework.beans.MutablePropertyValues;
021    import org.springframework.beans.PropertyValue;
022    import org.springframework.beans.factory.config.BeanDefinition;
023    import org.springframework.beans.factory.config.BeanDefinitionHolder;
024    import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
025    import org.springframework.beans.factory.config.ConstructorArgumentValues;
026    import org.springframework.beans.factory.config.RuntimeBeanReference;
027    
028    import java.util.Collection;
029    import java.util.Map;
030    
031    /**
032     * Walks a spring bean factory tree.
033     * @author Dain Sundstrom
034     * @version $Id$
035     * @since 2.0
036     */
037    public interface SpringVisitor {
038        void visitBeanFactory(ConfigurableListableBeanFactory beanRegistry, Object data) throws BeansException;
039    
040        void visitBeanDefinition(String beanName, BeanDefinition beanDefinition, Object data) throws BeansException;
041    
042        void visitBeanDefinition(BeanDefinition beanDefinition, Object data) throws BeansException;
043    
044        void visitMutablePropertyValues(MutablePropertyValues propertyValues, Object data) throws BeansException;
045    
046        void visitConstructorArgumentValues(ConstructorArgumentValues constructorArgumentValues, Object data) throws BeansException;
047    
048        void visitConstructorArgumentValue(ConstructorArgumentValues.ValueHolder valueHolder, Object data) throws BeansException;
049    
050        void visitPropertyValue(PropertyValue propertyValue, Object data) throws BeansException;
051    
052        void visitRuntimeBeanReference(RuntimeBeanReference beanReference, Object data) throws BeansException;
053    
054        void visitCollection(Collection collection, Object data)  throws BeansException;
055    
056        void visitMap(Map map, Object data)  throws BeansException;
057    
058        void visitObject(Object value, Object data) throws BeansException;
059    
060        void visitBeanDefinitionHolder(BeanDefinitionHolder beanDefinitionHolder, Object data) throws BeansException;
061    }