ymoks_UsrMsg_mok.java 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. XOWA: the XOWA Offline Wiki Application
  3. Copyright (C) 2012-2017 gnosygnu@gmail.com
  4. XOWA is licensed under the terms of the General Public License (GPL) Version 3,
  5. or alternatively under the terms of the Apache License Version 2.0.
  6. You may use XOWA according to either of these licenses as is most appropriate
  7. for your project on a case-by-case basis.
  8. The terms of each license can be found in the source code repository:
  9. GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
  10. Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
  11. */
  12. package gplx.gfml; import gplx.*;
  13. class UsrMsg_mok {
  14. public String Main() {return main;} public UsrMsg_mok Main_(String v) {main = v; return this;} private String main;
  15. public UsrMsg_mok Add_(String k, Object o) {hash.Add(k, Keyval_.new_(k, o)); return this;}
  16. public UsrMsg_mok Require_(String k) {required.Add(k, k); return this;}
  17. public Ordered_hash Args() {return hash;} Ordered_hash hash = Ordered_hash_.New();
  18. public Ordered_hash Required() {return required;} Ordered_hash required = Ordered_hash_.New();
  19. public static UsrMsg_mok new_(UsrMsg um) {
  20. UsrMsg_mok rv = new UsrMsg_mok();
  21. if (um != null) {
  22. rv.main = um.Hdr();
  23. for (int i = 0; i < um.Args().Count(); i++) {
  24. Keyval kv = (Keyval)um.Args().Get_at(i);
  25. rv.Add_(kv.Key(), kv.Val());
  26. }
  27. }
  28. return rv;
  29. } UsrMsg_mok() {}
  30. }