mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.6.3.1'
This commit is contained in:
@@ -130,7 +130,7 @@ class DsvParser {
|
||||
nextValType = ValType_Data;
|
||||
lineMode = LineType_Data;
|
||||
}
|
||||
String_bldr sb = String_bldr_.new_(); List_adp tkns = List_adp_.new_(); DsvTblBldr bldr = DsvTblBldr.new_();
|
||||
String_bldr sb = String_bldr_.new_(); List_adp tkns = List_adp_.New(); DsvTblBldr bldr = DsvTblBldr.new_();
|
||||
boolean cmdSeqOn = false, qteOn = false, csvOn = false;
|
||||
int nextValType = ValType_Data, lineMode = LineType_Data;
|
||||
@gplx.Internal protected static DsvParser dsv_() {return new DsvParser();}
|
||||
@@ -138,7 +138,7 @@ class DsvParser {
|
||||
DsvParser rv = new DsvParser();
|
||||
rv.csvOn = true;
|
||||
rv.lineMode = hasHdr ? LineType_FldNames : LineType_Data;
|
||||
List_adp names = List_adp_.new_(), types = List_adp_.new_();
|
||||
List_adp names = List_adp_.New(), types = List_adp_.New();
|
||||
for (int i = 0; i < flds.Count(); i++) {
|
||||
GfoFld fld = flds.Get_at(i);
|
||||
names.Add(fld.Key()); types.Add(fld.Type().Key());
|
||||
@@ -146,8 +146,8 @@ class DsvParser {
|
||||
rv.bldr.MakeFldNames(names); rv.bldr.MakeFldTypes(types);
|
||||
return rv;
|
||||
}
|
||||
static final int ValType_Data = 0, ValType_CmdName = 1;
|
||||
static final int LineType_Data = 0, LineType_Comment = 1, LineType_TblBgn = 2, LineType_FldNames = 3, LineType_FldTypes = 4, LineType_BlankLine = 5;
|
||||
static final int ValType_Data = 0, ValType_CmdName = 1;
|
||||
static final int LineType_Data = 0, LineType_Comment = 1, LineType_TblBgn = 2, LineType_FldNames = 3, LineType_FldTypes = 4, LineType_BlankLine = 5;
|
||||
}
|
||||
class DsvTblBldr {
|
||||
public void Init() {
|
||||
@@ -240,9 +240,9 @@ class DsvTblBldr {
|
||||
}
|
||||
}
|
||||
GfoNde root; GfoNde tbl; DsvStoreLayout layout = DsvStoreLayout.dsv_brief_();
|
||||
List_adp fldNames = List_adp_.new_(); List_adp fldTypes = List_adp_.new_();
|
||||
List_adp fldNames = List_adp_.New(); List_adp fldTypes = List_adp_.New();
|
||||
int stage = Stage_Init;
|
||||
public static DsvTblBldr new_() {return new DsvTblBldr();} DsvTblBldr() {this.Init();}
|
||||
@gplx.Internal protected static final String NullTblName = "";
|
||||
static final int Stage_Init = 0, Stage_Hdr = 1, Stage_Row = 2;
|
||||
@gplx.Internal protected static final String NullTblName = "";
|
||||
static final int Stage_Init = 0, Stage_Hdr = 1, Stage_Row = 2;
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ class DsvDataRdr_fxt {
|
||||
public DsvDataRdr_fxt tst_FldListCsv(String... names) {return tst_Flds(TblIdx0, GfoFldList_.str_(names));}
|
||||
public DsvDataRdr_fxt tst_Flds(int tblIdx, GfoFldList expdFlds) {
|
||||
GfoNde tbl = root.Subs().FetchAt_asGfoNde(tblIdx);
|
||||
List_adp expdList = List_adp_.new_(), actlList = List_adp_.new_();
|
||||
List_adp expdList = List_adp_.New(), actlList = List_adp_.New();
|
||||
String_bldr sb = String_bldr_.new_();
|
||||
GfoFldList_BldDbgList(expdFlds, expdList, sb);
|
||||
GfoFldList_BldDbgList(tbl.SubFlds(), actlList, sb);
|
||||
@@ -168,7 +168,7 @@ class DsvDataRdr_fxt {
|
||||
}
|
||||
}
|
||||
public DsvDataRdr_fxt tst_Tbls(String... expdNames) {
|
||||
List_adp actlList = List_adp_.new_();
|
||||
List_adp actlList = List_adp_.New();
|
||||
for (int i = 0; i < root.Subs().Count(); i++) {
|
||||
GfoNde tbl = root.Subs().FetchAt_asGfoNde(i);
|
||||
actlList.Add(tbl.Name());
|
||||
@@ -187,7 +187,7 @@ class DsvDataRdr_fxt {
|
||||
Tfds.Eq(0, tbl.Subs().Count());
|
||||
return this;
|
||||
}
|
||||
List_adp expdList = List_adp_.new_(), actlList = List_adp_.new_();
|
||||
List_adp expdList = List_adp_.New(), actlList = List_adp_.New();
|
||||
String_bldr sb = String_bldr_.new_();
|
||||
for (int i = 0; i < tbl.Subs().Count(); i++) {
|
||||
GfoNde row = tbl.Subs().FetchAt_asGfoNde(i);
|
||||
@@ -212,5 +212,5 @@ class DsvDataRdr_fxt {
|
||||
return this;
|
||||
}
|
||||
public static DsvDataRdr_fxt new_() {return new DsvDataRdr_fxt();}
|
||||
static final int TblIdx0 = 0;
|
||||
static final int TblIdx0 = 0;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class DsvHeaderList {
|
||||
public DsvHeaderList Add_Comment(String comment) {this.Add(new DsvHeaderItm(DsvHeaderItm.Id_Comment, comment)); return this;}
|
||||
void Add(DsvHeaderItm data) {list.Add(data);}
|
||||
|
||||
List_adp list = List_adp_.new_();
|
||||
List_adp list = List_adp_.New();
|
||||
public static DsvHeaderList new_() {return new DsvHeaderList();} DsvHeaderList() {}
|
||||
}
|
||||
class DsvHeaderItm {
|
||||
@@ -34,7 +34,7 @@ class DsvHeaderItm {
|
||||
public Object Val() {return val;} Object val;
|
||||
@gplx.Internal protected DsvHeaderItm(int id, Object val) {this.id = id; this.val = val;}
|
||||
|
||||
public static final int
|
||||
public static final int
|
||||
Id_Comment = 1
|
||||
, Id_TableName = 2
|
||||
, Id_BlankLine = 3
|
||||
|
||||
@@ -17,24 +17,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.langs.gfs; import gplx.*; import gplx.langs.*;
|
||||
import gplx.core.gfo_regys.*;
|
||||
public class GfsCore implements GfoInvkAble {
|
||||
public GfoInvkAble Root() {return root;}
|
||||
public class GfsCore implements Gfo_invk {
|
||||
public Gfo_invk Root() {return root;}
|
||||
@gplx.Internal protected GfsRegy Root_as_regy() {return root;} GfsRegy root = GfsRegy.new_();
|
||||
public void Clear() {root.Clear();}
|
||||
public GfoMsgParser MsgParser() {return msgParser;} public GfsCore MsgParser_(GfoMsgParser v) {msgParser = v; return this;} GfoMsgParser msgParser;
|
||||
public void Del(String key) {root.Del(key);}
|
||||
public void AddLib(GfsLibIni... ary) {for (GfsLibIni itm : ary) itm.Ini(this);}
|
||||
public void AddCmd(GfoInvkAble invk, String key) {root.AddCmd(invk, key);}
|
||||
public void AddObj(GfoInvkAble invk, String key) {root.AddObj(invk, key);}
|
||||
public void AddDeep(GfoInvkAble invk, String... ary) {
|
||||
GfoInvkCmdMgrOwner cur = (GfoInvkCmdMgrOwner)((GfsRegyItm)root.Get_by(ary[0])).InvkAble();
|
||||
public void AddCmd(Gfo_invk invk, String key) {root.AddCmd(invk, key);}
|
||||
public void AddObj(Gfo_invk invk, String key) {root.AddObj(invk, key);}
|
||||
public void AddDeep(Gfo_invk invk, String... ary) {
|
||||
Gfo_invk_cmd_mgr_owner cur = (Gfo_invk_cmd_mgr_owner)((GfsRegyItm)root.Get_by(ary[0])).InvkAble();
|
||||
for (int i = 1; i < ary.length - 1; i++)
|
||||
cur = (GfoInvkCmdMgrOwner)cur.InvkMgr().Invk(GfsCtx.Instance, 0, ary[i], GfoMsg_.Null, cur);
|
||||
cur = (Gfo_invk_cmd_mgr_owner)cur.InvkMgr().Invk(GfsCtx.Instance, 0, ary[i], GfoMsg_.Null, cur);
|
||||
cur.InvkMgr().Add_cmd(ary[ary.length - 1], invk);
|
||||
}
|
||||
public String FetchKey(GfoInvkAble invk) {return root.FetchByType(invk).Key();}
|
||||
public String FetchKey(Gfo_invk invk) {return root.FetchByType(invk).Key();}
|
||||
public Object ExecOne(GfsCtx ctx, GfoMsg msg) {return GfsCore_.Exec(ctx, root, msg, null, 0);}
|
||||
public Object ExecOne_to(GfsCtx ctx, GfoInvkAble invk, GfoMsg msg) {return GfsCore_.Exec(ctx, invk, msg, null, 0);}
|
||||
public Object ExecOne_to(GfsCtx ctx, Gfo_invk invk, GfoMsg msg) {return GfsCore_.Exec(ctx, invk, msg, null, 0);}
|
||||
public Object ExecMany(GfsCtx ctx, GfoMsg rootMsg) {
|
||||
Object rv = null;
|
||||
for (int i = 0; i < rootMsg.Subs_count(); i++) {
|
||||
@@ -55,13 +55,13 @@ public class GfsCore implements GfoInvkAble {
|
||||
}
|
||||
public Object ExecFile_ignoreMissing(Io_url url) {if (!Io_mgr.Instance.ExistsFil(url)) return null; return ExecText(Io_mgr.Instance.LoadFilStr(url));}
|
||||
public Object ExecFile(Io_url url) {return ExecText(Io_mgr.Instance.LoadFilStr(url));}
|
||||
public Object ExecFile_ignoreMissing(GfoInvkAble root, Io_url url) {
|
||||
public Object ExecFile_ignoreMissing(Gfo_invk root, Io_url url) {
|
||||
if (!Io_mgr.Instance.ExistsFil(url)) return null;
|
||||
if (msgParser == null) throw Err_.new_wo_type("msgParser is null");
|
||||
return Exec_bry(Io_mgr.Instance.LoadFilBry(url), root);
|
||||
}
|
||||
public Object Exec_bry(byte[] bry) {return Exec_bry(bry, root);}
|
||||
public Object Exec_bry(byte[] bry, GfoInvkAble root) {
|
||||
public Object Exec_bry(byte[] bry, Gfo_invk root) {
|
||||
GfoMsg rootMsg = msgParser.ParseToMsg(String_.new_u8(bry));
|
||||
Object rv = null;
|
||||
GfsCtx ctx = GfsCtx.new_();
|
||||
@@ -82,9 +82,9 @@ public class GfsCore implements GfoInvkAble {
|
||||
if (ctx.Deny()) return this;
|
||||
return ExecFile(url);
|
||||
}
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
// return this;
|
||||
} public static final String Invk_ExecFil = "ExecFil";
|
||||
public static final GfsCore Instance = new GfsCore();
|
||||
} public static final String Invk_ExecFil = "ExecFil";
|
||||
public static final GfsCore Instance = new GfsCore();
|
||||
@gplx.Internal protected static GfsCore new_() {return new GfsCore();}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.langs.gfs; import gplx.*; import gplx.langs.*;
|
||||
import gplx.core.strings.*;
|
||||
class GfsCoreHelp implements GfoInvkAble {
|
||||
class GfsCoreHelp implements Gfo_invk {
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
String path = m.ReadStrOr("path", "");
|
||||
if (String_.Eq(path, "")) {
|
||||
@@ -37,16 +37,16 @@ class GfsCoreHelp implements GfoInvkAble {
|
||||
sb.Add_spr_unless_first(itmAry[j], ".", j);
|
||||
return Err_Unhandled(sb.To_str(), itmAry[i]);
|
||||
}
|
||||
static Object Exec(GfsCtx rootCtx, GfoInvkAble rootInvk, String path) {
|
||||
static Object Exec(GfsCtx rootCtx, Gfo_invk rootInvk, String path) {
|
||||
String[] itmAry = String_.Split(path, ".");
|
||||
GfoInvkAble invk = rootInvk;
|
||||
Gfo_invk invk = rootInvk;
|
||||
GfsCtx ctx = GfsCtx.new_();
|
||||
Object curRv = null;
|
||||
for (int i = 0; i < itmAry.length; i++) {
|
||||
String itm = itmAry[i];
|
||||
curRv = invk.Invk(ctx, 0, itm, GfoMsg_.Null);
|
||||
if (curRv == GfoInvkAble_.Rv_unhandled) throw Err_Unhandled(itmAry, i);
|
||||
invk = GfoInvkAble_.as_(curRv);
|
||||
if (curRv == Gfo_invk_.Rv_unhandled) throw Err_Unhandled(itmAry, i);
|
||||
invk = (Gfo_invk)curRv;
|
||||
}
|
||||
GfsCoreHelp helpData = GfsCoreHelp.as_(curRv);
|
||||
if (helpData != null) { // last itm is actually Method
|
||||
|
||||
@@ -17,19 +17,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.langs.gfs; import gplx.*; import gplx.langs.*;
|
||||
public class GfsCore_ {
|
||||
public static final String Arg_primitive = "v";
|
||||
public static Object Exec(GfsCtx ctx, GfoInvkAble owner_invk, GfoMsg owner_msg, Object owner_primitive, int depth) {
|
||||
if (owner_msg.Args_count() == 0 && owner_msg.Subs_count() == 0 && String_.Eq(owner_msg.Key(), "")) {UsrDlg_.Instance.Warn("empty msg"); return GfoInvkAble_.Rv_unhandled;}
|
||||
public static final String Arg_primitive = "v";
|
||||
public static Object Exec(GfsCtx ctx, Gfo_invk owner_invk, GfoMsg owner_msg, Object owner_primitive, int depth) {
|
||||
if (owner_msg.Args_count() == 0 && owner_msg.Subs_count() == 0 && String_.Eq(owner_msg.Key(), "")) {UsrDlg_.Instance.Warn("empty msg"); return Gfo_invk_.Rv_unhandled;}
|
||||
if (owner_primitive != null) owner_msg.Parse_(false).Add(GfsCore_.Arg_primitive, owner_primitive);
|
||||
Object rv = owner_invk.Invk(ctx, 0, owner_msg.Key(), owner_msg);
|
||||
if (rv == GfoInvkAble_.Rv_cancel) return rv;
|
||||
else if (rv == GfoInvkAble_.Rv_unhandled) {
|
||||
if (rv == Gfo_invk_.Rv_cancel) return rv;
|
||||
else if (rv == Gfo_invk_.Rv_unhandled) {
|
||||
if (ctx.Fail_if_unhandled())
|
||||
throw Err_.new_wo_type("Object does not support key", "key", owner_msg.Key(), "ownerType", Type_adp_.FullNameOf_obj(owner_invk));
|
||||
else {
|
||||
Gfo_usr_dlg usr_dlg = ctx.Usr_dlg();
|
||||
if (usr_dlg != null) usr_dlg.Warn_many(GRP_KEY, "unhandled_key", "Object does not support key: key=~{0} ownerType=~{1}", owner_msg.Key(), Type_adp_.FullNameOf_obj(owner_invk));
|
||||
return GfoInvkAble_.Null;
|
||||
return Gfo_invk_.Noop;
|
||||
}
|
||||
}
|
||||
if (owner_msg.Subs_count() == 0) { // msg is leaf
|
||||
@@ -41,7 +41,7 @@ public class GfsCore_ {
|
||||
return regyItm.InvkAble();
|
||||
}
|
||||
else { // intermediate; cast to invk and call Exec
|
||||
GfoInvkAble invk = GfoInvkAble_.as_(rv);
|
||||
Gfo_invk invk = Gfo_invk_.as_(rv);
|
||||
Object primitive = null;
|
||||
if (invk == null) { // rv is primitive; find appropriate mgr
|
||||
Class<?> type = rv.getClass();
|
||||
@@ -60,7 +60,7 @@ public class GfsCore_ {
|
||||
}
|
||||
static final String GRP_KEY = "gplx.gfs_core";
|
||||
}
|
||||
// class GfsRegyMgr : GfoInvkAble {
|
||||
// class GfsRegyMgr : Gfo_invk {
|
||||
// public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
// if (ctx.Match(k, Invk_Add)) {
|
||||
// String libKey = m.ReadStr("libKey"), regKey = m.ReadStr("regKey");
|
||||
@@ -84,9 +84,9 @@ public class GfsCore_ {
|
||||
// GfoMsg loadMsg = core.MsgParser().ParseToMsg(loadText);
|
||||
// return core.Exec(ctx, loadMsg);
|
||||
// }
|
||||
// else return GfoInvkAble_.Rv_unhandled;
|
||||
// else return Gfo_invk_.Rv_unhandled;
|
||||
// return this;
|
||||
// } public static final String Invk_Add = "Add", Invk_Del = "Del", Invk_Load = "Load";
|
||||
// } public static final String Invk_Add = "Add", Invk_Del = "Del", Invk_Load = "Load";
|
||||
// GfsCore core; GfsRegy regy;
|
||||
// public static GfsRegyMgr new_(GfsCore core, GfsRegy regy) {
|
||||
// GfsRegyMgr rv = new GfsRegyMgr();
|
||||
|
||||
@@ -51,7 +51,7 @@ public class GfsCore_tst {
|
||||
@Test public void EmptyMsg() {
|
||||
tst_Msg
|
||||
( msg_("")
|
||||
, GfoInvkAble_.Rv_unhandled);
|
||||
, Gfo_invk_.Rv_unhandled);
|
||||
}
|
||||
// @Test public void Fail_argMissing() { // String_.Len()
|
||||
// tst_String__Len_Err(msg_("Len"), GfsCtx.Err_KeyNotFound("v", "<<EMPTY>>"));
|
||||
@@ -93,14 +93,14 @@ public class GfsCore_tst {
|
||||
Tfds.Eq(expd, actl);
|
||||
}
|
||||
}
|
||||
class GfsCore_tst_nest implements GfoInvkAble, GfoInvkCmdMgrOwner {
|
||||
public GfoInvkCmdMgr InvkMgr() {return invkMgr;} GfoInvkCmdMgr invkMgr = GfoInvkCmdMgr.new_();
|
||||
class GfsCore_tst_nest implements Gfo_invk, Gfo_invk_cmd_mgr_owner {
|
||||
public Gfo_invk_cmd_mgr InvkMgr() {return invkMgr;} Gfo_invk_cmd_mgr invkMgr = Gfo_invk_cmd_mgr.new_();
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Prop1)) {return prop1;}
|
||||
else if (ctx.Match(k, Prop2)) {return prop2;}
|
||||
else if (ctx.Match(k, prop1)) {return this;}
|
||||
else return invkMgr.Invk(ctx, ikey, k, m, this);
|
||||
} public static final String Prop1 = "Prop1", Prop2 = "Prop2";
|
||||
} public static final String Prop1 = "Prop1", Prop2 = "Prop2";
|
||||
String prop1, prop2;
|
||||
public static GfsCore_tst_nest new_(String prop1, String prop2) {
|
||||
GfsCore_tst_nest rv = new GfsCore_tst_nest();
|
||||
@@ -108,6 +108,6 @@ class GfsCore_tst_nest implements GfoInvkAble, GfoInvkCmdMgrOwner {
|
||||
return rv;
|
||||
} GfsCore_tst_nest() {}
|
||||
}
|
||||
class GfsTest_cmd implements GfoInvkAble {
|
||||
class GfsTest_cmd implements Gfo_invk {
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {return m.ReadStr("s");}
|
||||
}
|
||||
|
||||
@@ -16,20 +16,20 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.langs.gfs; import gplx.*; import gplx.langs.*;
|
||||
class GfsRegy implements GfoInvkAble {
|
||||
class GfsRegy implements Gfo_invk {
|
||||
public int Count() {return hash.Count();}
|
||||
public void Clear() {hash.Clear(); typeHash.Clear();}
|
||||
public boolean Has(String k) {return hash.Has(k);}
|
||||
public GfsRegyItm Get_at(int i) {return (GfsRegyItm)hash.Get_at(i);}
|
||||
public GfsRegyItm Get_by(String key) {return (GfsRegyItm)hash.Get_by(key);}
|
||||
public GfsRegyItm FetchByType(GfoInvkAble invk) {return (GfsRegyItm)typeHash.Get_by(Type_adp_.FullNameOf_obj(invk));}
|
||||
public GfsRegyItm FetchByType(Gfo_invk invk) {return (GfsRegyItm)typeHash.Get_by(Type_adp_.FullNameOf_obj(invk));}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
Object rv = (GfsRegyItm)hash.Get_by(k); if (rv == null) throw Err_.new_missing_key(k);
|
||||
return rv;
|
||||
}
|
||||
public void AddObj(GfoInvkAble invk, String key) {Add(key, invk, false);}
|
||||
public void AddCmd(GfoInvkAble invk, String key) {Add(key, invk, true);}
|
||||
public void Add(String key, GfoInvkAble invk, boolean typeCmd) {
|
||||
public void AddObj(Gfo_invk invk, String key) {Add(key, invk, false);}
|
||||
public void AddCmd(Gfo_invk invk, String key) {Add(key, invk, true);}
|
||||
public void Add(String key, Gfo_invk invk, boolean typeCmd) {
|
||||
if (hash.Has(key)) return;
|
||||
GfsRegyItm regyItm = new GfsRegyItm().Key_(key).InvkAble_(invk).IsCmd_(typeCmd).TypeKey_(Type_adp_.FullNameOf_obj(invk));
|
||||
hash.Add(key, regyItm);
|
||||
@@ -40,15 +40,15 @@ class GfsRegy implements GfoInvkAble {
|
||||
if (itm != null) typeHash.Del(itm.TypeKey());
|
||||
hash.Del(k);
|
||||
}
|
||||
Hash_adp typeHash = Hash_adp_.new_();
|
||||
Hash_adp typeHash = Hash_adp_.New();
|
||||
Ordered_hash hash = Ordered_hash_.New();
|
||||
public static GfsRegy new_() {return new GfsRegy();} GfsRegy() {}
|
||||
}
|
||||
class GfsRegyItm implements GfoInvkAble {
|
||||
class GfsRegyItm implements Gfo_invk {
|
||||
public String Key() {return key;} public GfsRegyItm Key_(String v) {key = v; return this;} private String key;
|
||||
public String TypeKey() {return typeKey;} public GfsRegyItm TypeKey_(String v) {typeKey = v; return this;} private String typeKey;
|
||||
public boolean IsCmd() {return isCmd;} public GfsRegyItm IsCmd_(boolean v) {isCmd = v; return this;} private boolean isCmd;
|
||||
public GfoInvkAble InvkAble() {return invkAble;} public GfsRegyItm InvkAble_(GfoInvkAble v) {invkAble = v; return this;} GfoInvkAble invkAble;
|
||||
public Gfo_invk InvkAble() {return invkAble;} public GfsRegyItm InvkAble_(Gfo_invk v) {invkAble = v; return this;} Gfo_invk invkAble;
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {return invkAble.Invk(ctx, ikey, k, m);}
|
||||
public static GfsRegyItm as_(Object obj) {return obj instanceof GfsRegyItm ? (GfsRegyItm)obj : null;}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Gfs_Date_tst {
|
||||
class GfsCoreFxt {
|
||||
public GfsCore Core() {return core;} GfsCore core = GfsCore.new_();
|
||||
public GfoMsg msg_(String[] ary, Keyval... kvAry) {return GfoMsg_.root_leafArgs_(ary, kvAry);}
|
||||
public void AddObj(GfoInvkAble invk, String s) {core.AddObj(invk, s);}
|
||||
public void AddObj(Gfo_invk invk, String s) {core.AddObj(invk, s);}
|
||||
public void tst_MsgStr(GfoMsg msg, Object expd) {
|
||||
GfsCtx ctx = GfsCtx.new_();
|
||||
Object actl = core.ExecOne(ctx, msg);
|
||||
|
||||
@@ -24,7 +24,7 @@ public class Regx_adp {
|
||||
public boolean Pattern_is_invalid() {return pattern_is_invalid;} private boolean pattern_is_invalid = false;
|
||||
public Regx_match[] Match_all(String text, int bgn) {
|
||||
int idx = bgn;
|
||||
List_adp rv = List_adp_.new_();
|
||||
List_adp rv = List_adp_.New();
|
||||
int len = String_.Len(text);
|
||||
while (idx <= len) { // NOTE: must be <= not < else "a?" will return null instead of ""; PAGE:en.d:民; DATE:2015-01-30
|
||||
Regx_match match = this.Match(text, idx);
|
||||
|
||||
@@ -21,7 +21,7 @@ public class Regx_adp_ {
|
||||
public static List_adp Find_all(String input, String find) {
|
||||
Regx_adp regx = Regx_adp_.new_(find);
|
||||
int idx = 0;
|
||||
List_adp rv = List_adp_.new_();
|
||||
List_adp rv = List_adp_.New();
|
||||
while (true) {
|
||||
Regx_match match = regx.Match(input, idx);
|
||||
if (match.Rslt_none()) break;
|
||||
|
||||
@@ -73,7 +73,7 @@ public class Regx_adp__tst implements TfdsEqListItmStr {
|
||||
Tfds.Eq_ary_str(expd, To_ary(rslts));
|
||||
}
|
||||
String[] To_ary(Regx_match[] ary) {
|
||||
List_adp rv = List_adp_.new_();
|
||||
List_adp rv = List_adp_.New();
|
||||
int len = ary.length;
|
||||
for (int i = 0; i < len; i++) {
|
||||
Regx_match itm = ary[i];
|
||||
|
||||
@@ -30,6 +30,6 @@ class XmlNdeList_cls_list implements XmlNdeList {
|
||||
public int Count() {return list.Count();}
|
||||
public XmlNde Get_at(int i) {return (XmlNde)list.Get_at(i);}
|
||||
public void Add(XmlNde xnde) {list.Add(xnde);}
|
||||
@gplx.Internal protected XmlNdeList_cls_list(int count) {list = List_adp_.new_(); list.Resize_bounds(count);} List_adp list;
|
||||
@gplx.Internal protected XmlNdeList_cls_list(int count) {list = List_adp_.New(); list.Resize_bounds(count);} List_adp list;
|
||||
}
|
||||
//#}
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.langs.xmls; import gplx.*; import gplx.langs.*;
|
||||
import gplx.core.ios.*;
|
||||
import gplx.core.ios.streams.*;
|
||||
public class XmlSplitRdr {
|
||||
public byte[] CurAry() {return curAry;} private byte[] curAry;
|
||||
public long CurSum() {return curSum;} long curSum;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.langs.xmls; import gplx.*; import gplx.langs.*;
|
||||
import gplx.core.ios.*;
|
||||
import gplx.core.ios.streams.*;
|
||||
public class XmlSplitWtr {
|
||||
public Io_url Url() {return url;} Io_url url;
|
||||
public XmlSplitWtr Init_(Io_url partDir, byte[] hdr, XmlFileSplitterOpts opts) {
|
||||
|
||||
@@ -34,7 +34,7 @@ public class Xpath_ {
|
||||
return list;
|
||||
}
|
||||
static XmlNdeList Select(XmlNde owner, String xpath, Xpath_Args args) {
|
||||
XmlNdeList_cls_list rv = new XmlNdeList_cls_list(List_adp_.Capacity_initial);
|
||||
XmlNdeList_cls_list rv = new XmlNdeList_cls_list(8);
|
||||
String[] parts = String_.Split(xpath, "/");
|
||||
TraverseSubs(owner, parts, 0, rv, args);
|
||||
return rv;
|
||||
@@ -56,7 +56,7 @@ public class Xpath_ {
|
||||
TraverseSubs(sub, parts, depth + 1, results, args);
|
||||
}
|
||||
}
|
||||
public static final String InnetTextKey = "&innerText";
|
||||
public static final String InnetTextKey = "&innerText";
|
||||
public static Keyval_hash ExtractKeyVals(String xml, Int_obj_ref posRef, String nodeName) {
|
||||
int pos = posRef.Val();
|
||||
Err xmlErr = Err_.new_wo_type("error parsing xml", "xml", xml, "pos", pos);
|
||||
|
||||
Reference in New Issue
Block a user