Clover Coverage Report - Kuali Student 1.2.1-SNAPSHOT (Aggregated)
Coverage timestamp: Wed Nov 2 2011 04:03:58 EST
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
11   51   7   5.5
6   26   0.64   2
2     3.5  
1    
 
  ModBeanDefinitionVisitor       Line # 23 11 0% 7 0 100% 1.0
 
  (1)
 
1    /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10    * software distributed under the License is distributed on an "AS IS"
11    * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12    * or implied. See the License for the specific language governing
13    * permissions and limitations under the License.
14    */
15   
16    package org.kuali.student.common.util;
17   
18    import org.kuali.student.common.util.ModPropertyPlaceholderConfigurer.PlaceholderResolvingStringValueResolver;
19    import org.springframework.beans.factory.config.BeanDefinitionVisitor;
20    import org.springframework.beans.factory.config.TypedStringValue;
21    import org.springframework.util.StringValueResolver;
22   
 
23    public class ModBeanDefinitionVisitor extends BeanDefinitionVisitor {
24   
25    PlaceholderResolvingStringValueResolver valueResolver;
26   
 
27  22 toggle public ModBeanDefinitionVisitor(StringValueResolver valueResolver) {
28  22 super(valueResolver);
29  22 this.valueResolver=(PlaceholderResolvingStringValueResolver) valueResolver;
30    }
31   
32   
 
33  1588 toggle @Override
34    protected Object resolveValue(Object value) {
35  1588 value = super.resolveValue(value);
36  1588 String strValue = null;
37   
38  1588 if(value instanceof String){
39  96 strValue=(String)value;
40  1492 }else if(value instanceof TypedStringValue){
41  644 strValue=((TypedStringValue)value).getValue();
42    }
43   
44  1588 if(strValue!=null&&strValue.startsWith("$[") && strValue.endsWith("]")){
45  57 value = valueResolver.resolvePropertyValue(strValue.substring(2, strValue.length()-1));
46    }
47   
48  1588 return value;
49    }
50   
51    }