1 9 package org.jboss.portal.setup.util; 10 11 12 import java.beans.PropertyEditor ; 13 import java.beans.PropertyEditorSupport ; 14 15 22 public abstract class PropertyEditorBase extends PropertyEditorSupport implements PropertyEditor 23 { 24 25 private Object m_value = null; 26 private String m_strValue = null; 27 private Class m_class = null; 28 29 32 public Object getValue() 33 { 34 return m_value; 35 } 36 37 40 public void setValue(Object o) 41 { 42 m_value = o; 43 m_strValue = converToString(o); 44 } 45 46 49 public String getAsText() 50 { 51 return m_strValue; 52 } 53 54 57 public void setAsText(String s) throws IllegalArgumentException 58 { 59 m_strValue = s; 60 m_value = convertToValue(s); 61 } 62 63 67 protected abstract String converToString(Object value); 68 69 73 protected abstract Object convertToValue(String strValue); 74 75 78 protected void setClassType(Class type) 79 { 80 m_class = type; 81 } 82 83 84 } 85 | Popular Tags |