1 package org.apache.fulcrum.intake.model; 2 3 56 57 import org.apache.fulcrum.intake.xmlmodel.XmlField; 58 import org.apache.log4j.Category; 59 import org.apache.torque.om.ComboKey; 60 61 66 public class ComboKeyField 67 extends Field 68 { 69 70 Category category = Category.getInstance(getClass().getName()); 71 72 public ComboKeyField(XmlField field, Group group) 73 throws Exception 74 { 75 super(field, group); 76 } 77 78 83 protected void setDefaultValue(String prop) 84 { 85 defaultValue = prop; 86 } 87 88 91 protected void doSetValue() 92 { 93 try 94 { 95 if ( isMultiValued ) 96 { 97 String [] ss = pp.getStrings(getKey()); 98 ComboKey[] ival = new ComboKey[ss.length]; 99 for (int i=0; i<ss.length; i++) 100 { 101 ival[i] = new ComboKey(ss[i]); 102 } 103 setTestValue(ival); 104 } 105 else 106 { 107 setTestValue( new ComboKey(pp.getString(getKey())) ); 108 } 109 } 110 catch (Exception e) 111 { 112 valid_flag = false; 113 category.error(e); 114 } 115 } 116 } 117 | Popular Tags |