1 17 18 package org.apache.geronimo.common.propertyeditor; 19 20 26 public class CharacterEditor extends TextPropertyEditorSupport { 27 public Object getValue() 28 { 29 try { 30 String text = getAsText(); 31 if (text.length() != 1) { 32 throw new IllegalArgumentException ("wrong size: " + text); 33 } 34 return new Character (text.toCharArray()[0]); 35 } 36 catch (Exception e) { 37 throw new PropertyEditorException(e); 38 } 39 } 40 } 41 | Popular Tags |