Exemple #1
0
 public String To_str(Object o) {
   if (o == null) return "<<NULL>>";
   Class<?> type = Type_adp_.ClassOf_obj(o);
   String rv = null;
   if (type == String.class) rv = String_.cast(o);
   else if (Int_.TypeMatch(type)) return Int_.To_str(Int_.cast(o));
   else if (Type_adp_.Eq(type, Bool_.Cls_ref_type)) return Yn.To_str(Bool_.cast(o));
   else if (type == DateAdp.class) return DateAdp_.cast(o).XtoStr_gplx();
   else rv = Object_.Xto_str_strict_or_empty(o);
   return String_.Replace(rv, "'", "''");
 }
Exemple #2
0
 public boolean ReadYn_toggle(String k, boolean cur) {
   Object rv = ReadOr(k, "!");
   if (rv == Nil) ThrowNotFound(k);
   if (!parse) throw Err_.new_wo_type("only parse supported");
   String rv_str = (String) rv;
   return (String_.Eq(rv_str, "!")) ? !cur : Yn.parse(rv_str);
 }
Exemple #3
0
 @gplx.Virtual
 protected Object ReadOr(String k, Object defaultOr) {
   if (args == null) return Nil; // WORKAROUND.gfui: args null for DataBndr_whenEvt_execCmd
   if (!String_.Eq(k, "")) {
     for (int i = 0; i < args.Count(); i++) {
       Keyval kv = (Keyval) args.Get_at(i);
       if (String_.Eq(k, kv.Key())) return kv.Val();
     }
   }
   if (counter >= args.Count()) return Nil;
   for (int i = 0; i < args.Count(); i++) {
     Keyval kv = (Keyval) args.Get_at(i);
     if (String_.Eq(kv.Key(), "") && i >= counter) {
       counter++;
       return kv.Val();
     }
   }
   return Nil;
 }
Exemple #4
0
 public GfoMsg Args_ovr(String k, Object v) {
   if (args == null) args = List_adp_.New();
   for (int i = 0; i < args.Count(); i++) {
     Keyval kv = (Keyval) args.Get_at(i);
     if (String_.Eq(k, kv.Key())) {
       kv.Val_(v);
       return this;
     }
   }
   args.Add(Keyval_.new_(k, v));
   return this;
 }
Exemple #5
0
 public String[] ReadStrAryIgnore(String k, String spr, String ignore) {
   return String_.Split(String_.Replace(ReadStr(k), ignore, ""), spr);
 }
Exemple #6
0
 public String[] ReadStrAry(String k, String spr) {
   return String_.Split(ReadStr(k), spr);
 }