Пример #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));
 }