Esempio n. 1
0
 /** Constructor, registering statically available XQuery functions. */
 private Functions() {
   for (final Function def : Function.values()) {
     final String dsc = def.desc;
     final byte[] ln = token(dsc.substring(0, dsc.indexOf(PAR1)));
     final int i = add(new QNm(ln, def.uri()).id());
     if (i < 0) Util.notexpected("Function defined twice:" + def);
     funcs[i] = def;
   }
 }
Esempio n. 2
0
 /**
  * Adds parameters from the passed on request body.
  *
  * @param body request body
  * @param params map parameters
  */
 private static void addParams(final String body, final Map<String, String[]> params) {
   for (final String nv : body.split("&")) {
     final String[] parts = nv.split("=", 2);
     if (parts.length < 2) continue;
     try {
       params.put(parts[0], new String[] {URLDecoder.decode(parts[1], Token.UTF8)});
     } catch (final Exception ex) {
       Util.notexpected(ex);
     }
   }
 }