1 22 package org.jboss.util.propertyeditor; 23 24 import java.beans.PropertyEditorSupport ; 25 26 33 public class CharacterEditor extends PropertyEditorSupport  34 { 35 public void setAsText(final String text) 36 { 37 if (PropertyEditors.isNull(text)) 38 { 39 setValue(null); 40 return; 41 } 42 if (text.length() != 1) 43 throw new IllegalArgumentException ("Too many (" + text.length() + ") characters: '" + text + "'"); 44 Object newValue = new Character (text.charAt(0)); 45 setValue(newValue); 46 } 47 } | Popular Tags |