Input implements Serializable { public static Map<String, Input> extractSimpleQueryParam(String script) { Map<String, Input> params = new HashMap<String, Input>(); if (script == null) { return params; } String replaced = script; Matcher match = VAR_PTN.matcher(replaced); while (match.find()) { Input param = getInputForm(match); params.put(param.name, param); } params.remove("pql"); return params; } Input(String name, Object defaultValue, String type);  Input(String name, Object defaultValue, String type, ParamOption[] options);  Input(String name, String displayName, String type, String argument, Object defaultValue,
      ParamOption[] options, boolean hidden); @Override boolean equals(Object o); String getName(); void setName(String name); String getDisplayName(); void setDisplayName(String displayName); String getType(); void setType(String type); Object getDefaultValue(); void setDefaultValue(Object defaultValue); ParamOption[] getOptions(); void setOptions(ParamOption[] options); boolean isHidden(); static Map<String, Input> extractSimpleQueryParam(String script); static String getSimpleQuery(Map<String, Object> params, String script); static String[] split(String str); static String[] splitPipe(String str); static String[] split(String str, char split); static String[] split(String str, String[] splitters, boolean includeSplitter); static String[] split(String str, String escapeSeq, char escapeChar, String[] blockStart,
      String[] blockEnd, String[] splitters, boolean includeSplitter);  }
@Test public void testFormExtraction() { String script = "${input_form=}"; Map<String, Input> forms = Input.extractSimpleQueryParam(script); assertEquals(1, forms.size()); Input form = forms.get("input_form"); assertEquals("input_form", form.name); assertNull(form.displayName); assertEquals("", form.defaultValue); assertNull(form.options); script = "${input_form(Input Form)=xxx}"; forms = Input.extractSimpleQueryParam(script); form = forms.get("input_form"); assertEquals("xxx", form.defaultValue); script = "${select_form(Selection Form)=op1,op1|op2(Option 2)|op3}"; form = Input.extractSimpleQueryParam(script).get("select_form"); assertEquals("select_form", form.name); assertEquals("op1", form.defaultValue); assertArrayEquals(new ParamOption[]{new ParamOption("op1", null), new ParamOption("op2", "Option 2"), new ParamOption("op3", null)}, form.options); script = "${checkbox:checkbox_form=op1,op1|op2|op3}"; form = Input.extractSimpleQueryParam(script).get("checkbox_form"); assertEquals("checkbox_form", form.name); assertEquals("checkbox", form.type); assertArrayEquals(new Object[]{"op1"}, (Object[]) form.defaultValue); assertArrayEquals(new ParamOption[]{new ParamOption("op1", null), new ParamOption("op2", null), new ParamOption("op3", null)}, form.options); script = "${checkbox:checkbox_form(Checkbox Form)=op1|op3,op1(Option 1)|op2|op3}"; form = Input.extractSimpleQueryParam(script).get("checkbox_form"); assertEquals("checkbox_form", form.name); assertEquals("Checkbox Form", form.displayName); assertEquals("checkbox", form.type); assertArrayEquals(new Object[]{"op1", "op3"}, (Object[]) form.defaultValue); assertArrayEquals(new ParamOption[]{new ParamOption("op1", "Option 1"), new ParamOption("op2", null), new ParamOption("op3", null)}, form.options); script = "${checkbox:checkbox_form(Checkbox Form)=,op1(Option 1)|op2(Option 2)|op3(Option 3)}"; form = Input.extractSimpleQueryParam(script).get("checkbox_form"); assertEquals("checkbox_form", form.name); assertEquals("Checkbox Form", form.displayName); assertEquals("checkbox", form.type); assertArrayEquals(new Object[]{}, (Object[]) form.defaultValue); assertArrayEquals(new ParamOption[]{new ParamOption("op1", "Option 1"), new ParamOption("op2", "Option 2"), new ParamOption("op3", "Option 3")}, form.options); }