1 /** 2 * Copyright 2005-2012 The Kuali Foundation 3 * 4 * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php 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 package org.kuali.rice.krad.datadictionary; 17 18 import org.springframework.beans.factory.config.BeanDefinition; 19 import org.springframework.beans.factory.config.BeanDefinitionHolder; 20 21 import java.util.List; 22 import java.util.Map; 23 import java.util.Set; 24 import java.util.Stack; 25 26 /** 27 * API for classes that perform post processing of the dictionary bean definitions 28 * 29 * @author Kuali Rice Team (rice.collab@kuali.org) 30 */ 31 public interface DictionaryBeanProcessor { 32 33 /** 34 * Invoked to process a root bean definition (a root bean definition is a top level bean) 35 * 36 * @param beanName name of the bean within the factory 37 * @param beanDefinition bean definition to process 38 */ 39 public void processRootBeanDefinition(String beanName, BeanDefinition beanDefinition); 40 41 /** 42 * Invoked to process a nested bean definition (a bean definition that is a property value of another 43 * bean definition) 44 * 45 * @param beanName name of the bean within the factory 46 * @param beanDefinition bean definition to process 47 * @param propertyName the name of the property which has the bean definition value 48 * @param nestedBeanStack the stack of beans which contain the given bean 49 */ 50 public void processNestedBeanDefinition(String beanName, BeanDefinition beanDefinition, String propertyName, 51 Stack<BeanDefinitionHolder> nestedBeanStack); 52 53 /** 54 * Invoked to process a string property value (straight property value, not a string within a collection) 55 * 56 * @param propertyName name of the property whose string value is being processed 57 * @param propertyValue string value for the property 58 * @return String new property value (possibly modified) 59 */ 60 public String processStringPropertyValue(String propertyName, String propertyValue, 61 Stack<BeanDefinitionHolder> nestedBeanStack); 62 63 /** 64 * Invoked to process a collection value that is a bean definition 65 * 66 * @param beanName name of the bean within the factory 67 * @param beanDefinition bean definition within the collection to process 68 * @param propertyName the name of the property which has the collection value 69 * @param nestedBeanStack the stack of beans which contain the given collection (and collection bean) 70 */ 71 public void processCollectionBeanDefinition(String beanName, BeanDefinition beanDefinition, String propertyName, 72 Stack<BeanDefinitionHolder> nestedBeanStack); 73 74 /** 75 * Invokes the processors to handle an array string value (which may be changed) 76 * 77 * @param propertyName name of the property that is being processed 78 * @param propertyValue the array which contains the string 79 * @param elementValue the string element value 80 * @param elementIndex the index of the string within the array 81 * @param nestedBeanStack the stack of bean containers, including the bean that contains the property 82 * @return String new property value (possibly modified by processors) 83 */ 84 public String processArrayStringPropertyValue(String propertyName, Object[] propertyValue, String elementValue, 85 int elementIndex, Stack<BeanDefinitionHolder> nestedBeanStack); 86 87 /** 88 * Invokes the processors to handle an list string value (which may be changed) 89 * 90 * @param propertyName name of the property that is being processed 91 * @param propertyValue the list which contains the string 92 * @param elementValue the string element value 93 * @param elementIndex the index of the string within the list 94 * @param nestedBeanStack the stack of bean containers, including the bean that contains the property 95 * @return String new property value (possibly modified by processors) 96 */ 97 public String processListStringPropertyValue(String propertyName, List<?> propertyValue, String elementValue, 98 int elementIndex, Stack<BeanDefinitionHolder> nestedBeanStack); 99 100 /** 101 * Invokes the processors to handle an set string value (which may be changed) 102 * 103 * @param propertyName name of the property that is being processed 104 * @param propertyValue the set which contains the string 105 * @param elementValue the string element value 106 * @param nestedBeanStack the stack of bean containers, including the bean that contains the property 107 * @return String new property value (possibly modified by processors) 108 */ 109 public String processSetStringPropertyValue(String propertyName, Set<?> propertyValue, String elementValue, 110 Stack<BeanDefinitionHolder> nestedBeanStack); 111 112 /** 113 * Invokes the processors to handle an map string value (which may be changed) 114 * 115 * @param propertyName name of the property that is being processed 116 * @param propertyValue the map which contains the string 117 * @param elementValue the string element value 118 * @param elementKey the key for the string within the map 119 * @param nestedBeanStack the stack of bean containers, including the bean that contains the property 120 * @return String new property value (possibly modified by processors) 121 */ 122 public String processMapStringPropertyValue(String propertyName, Map<?, ?> propertyValue, String elementValue, 123 Object elementKey, Stack<BeanDefinitionHolder> nestedBeanStack); 124 }