示例#1
0
  @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);
  }
示例#2
0
 @Override
 public Dynamic copy(Dynamic t) {
   return new Dynamic(Types.fromXML(t.type).checkCopy(t.value), t.type);
 }
示例#3
0
 @Override
 public String toDisplayString(Dynamic data) {
   return Types.fromXML(data.type).checkToDisplayString(data.value);
 }
示例#4
0
 @Override
 public String encode(Dynamic e) {
   return Types.fromXML(e.type).checkEncode(e.value) + ":" + e.type;
 }
示例#5
0
 @Override
 public void set(Dynamic t) {
   if (t == null) t = new Dynamic("", "String");
   data = t;
   typeChooser.setSelectedItem(Types.fromXML(t.type));
 }