@Override public Dynamic decode(String s) { int i = s.lastIndexOf(":"); if (i == -1) return new Dynamic(s, "String"); String value = s.substring(0, i); String type = s.substring(i + 1); return new Dynamic(Types.fromXML(type).decode(value), type); }
@Override public Dynamic copy(Dynamic t) { return new Dynamic(Types.fromXML(t.type).checkCopy(t.value), t.type); }
@Override public String toDisplayString(Dynamic data) { return Types.fromXML(data.type).checkToDisplayString(data.value); }
@Override public String encode(Dynamic e) { return Types.fromXML(e.type).checkEncode(e.value) + ":" + e.type; }
@Override public void set(Dynamic t) { if (t == null) t = new Dynamic("", "String"); data = t; typeChooser.setSelectedItem(Types.fromXML(t.type)); }