1 package jfun.yan.xml; 2 3 import java.beans.PropertyEditorSupport ; 4 5 import jfun.yan.util.deserializer.Deserializer; 6 7 8 14 public class SingletonModeEditor extends PropertyEditorSupport  15 implements Deserializer{ 16 public Object getValue() { 17 final Object val = super.getValue(); 18 if(val instanceof String ){ 19 return deserialize((String )val); 20 } 21 else return val; 22 } 23 public void setAsText(String txt){ 24 super.setValue(txt); 25 } 26 public Object deserialize(String str){ 27 return MyUtil.getSingletonStrategy(str, 28 BodyCompiler.current_location.getLocation(), null); 29 } 30 31 } 32 | Popular Tags |