Clover Coverage Report - Kuali Student 1.2-M2-SNAPSHOT (Aggregated)
Coverage timestamp: Fri Apr 22 2011 04:03:20 EST
../../../../../../img/srcFileCovDistChart9.png 32% of files have more coverage
7   25   5   3.5
4   20   0.71   2
2     2.5  
1    
 
  SimpleEnumPropertyEditor       Line # 5 7 0% 5 2 84.6% 0.84615386
 
  (14)
 
1    package org.kuali.student.common.util.spring;
2   
3    import java.beans.PropertyEditorSupport;
4   
 
5    public class SimpleEnumPropertyEditor extends PropertyEditorSupport {
6    Class<? extends Enum<?>> enumClass;
7   
 
8  3209 toggle @Override
9    public void setAsText(String text) throws IllegalArgumentException {
10  3209 for (Object e : enumClass.getEnumConstants()) {
11  28881 if (e.toString().toUpperCase().equals(text.toUpperCase())) {
12  3209 this.setValue(e);
13    }
14    }
15    }
16   
 
17  19 toggle public SimpleEnumPropertyEditor(Class<? extends Enum<?>> enumClass) {
18  19 super();
19  19 if(enumClass==null||!enumClass.isEnum()){
20  0 throw new IllegalArgumentException("Must set a valid Enum Class in the constructor");
21    }
22  19 this.enumClass = enumClass;
23    }
24   
25    }