test_class.file: smart-zeppelin/zeppelin-interpreter/src/test/java/org/apache/zeppelin/display/InputTest.java
test_class.identifier: InputTest
test_case.body: @Test
  	public void testFormExtraction() {
  		// input form
  		String script = "${input_form=}";
  		Map<String, Input> forms = Input.extractSimpleQueryForm(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);
  
  		// input form with display name & default value
  		script = "${input_form(Input Form)=xxx}";
  		forms = Input.extractSimpleQueryForm(script);
  		form = forms.get("input_form");
  		assertEquals("xxx", form.defaultValue);
  
  		// selection form
  		script = "${select_form(Selection Form)=op1,op1|op2(Option 2)|op3}";
  		form = Input.extractSimpleQueryForm(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);
  
  		// checkbox form
  		script = "${checkbox:checkbox_form=op1,op1|op2|op3}";
  		form = Input.extractSimpleQueryForm(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);
  
  		// checkbox form with multiple default checks
  		script = "${checkbox:checkbox_form(Checkbox Form)=op1|op3,op1(Option 1)|op2|op3}";
  		form = Input.extractSimpleQueryForm(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);
  
  		// checkbox form with no default check
  		script = "${checkbox:checkbox_form(Checkbox Form)=,op1(Option 1)|op2(Option 2)|op3(Option 3)}";
  		form = Input.extractSimpleQueryForm(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);
  	}
test_case.class_method_signature: InputTest.testFormExtraction()
test_case.full_signature: @Test public void testFormExtraction()
test_case.identifier: testFormExtraction
test_case.invocations: extractSimpleQueryForm assertEquals size get assertEquals assertNull assertEquals assertNull extractSimpleQueryForm get assertEquals get extractSimpleQueryForm assertEquals assertEquals assertArrayEquals get extractSimpleQueryForm assertEquals assertEquals assertArrayEquals assertArrayEquals get extractSimpleQueryForm assertEquals assertEquals assertEquals assertArrayEquals assertArrayEquals get extractSimpleQueryForm assertEquals assertEquals assertEquals assertArrayEquals assertArrayEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFormExtraction()
focal_class.declarator: name
focal_class.original_string: String name;
focal_class.type: String
focal_class.var_name: name
focal_class.declarator: displayName
focal_class.original_string: String displayName;
focal_class.type: String
focal_class.var_name: displayName
focal_class.declarator: type
focal_class.original_string: String type;
focal_class.type: String
focal_class.var_name: type
focal_class.declarator: argument
focal_class.original_string: String argument;
focal_class.type: String
focal_class.var_name: argument
focal_class.declarator: defaultValue
focal_class.original_string: Object defaultValue;
focal_class.type: Object
focal_class.var_name: defaultValue
focal_class.declarator: options
focal_class.original_string: ParamOption[] options;
focal_class.type: ParamOption[]
focal_class.var_name: options
focal_class.declarator: hidden
focal_class.original_string: boolean hidden;
focal_class.type: boolean
focal_class.var_name: hidden
focal_class.declarator: VAR_PTN = Pattern.compile("([_])?[$][{]([^=}]*([=][^}]*)?)[}]")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern VAR_PTN = Pattern.compile("([_])?[$][{]([^=}]*([=][^}]*)?)[}]");
focal_class.type: Pattern
focal_class.var_name: VAR_PTN
focal_class.declarator: DEFAULT_DELIMITER = ","
focal_class.modifier: private static final
focal_class.original_string: private static final String DEFAULT_DELIMITER = ",";
focal_class.type: String
focal_class.var_name: DEFAULT_DELIMITER
focal_class.file: smart-zeppelin/zeppelin-interpreter/src/main/java/org/apache/zeppelin/display/Input.java
focal_class.identifier: Input
focal_class.interfaces: implements Serializable
focal_class.class_method_signature: Input.Input(String name, Object defaultValue, String type)
focal_class.full_signature: public  Input(String name, Object defaultValue, String type)
focal_class.identifier: Input
focal_class.modifiers: public
focal_class.parameters: (String name, Object defaultValue, String type)
focal_class.signature:  Input(String name, Object defaultValue, String type)
focal_class.class_method_signature: Input.Input(String name, Object defaultValue, String type, ParamOption[] options)
focal_class.full_signature: public  Input(String name, Object defaultValue, String type, ParamOption[] options)
focal_class.identifier: Input
focal_class.modifiers: public
focal_class.parameters: (String name, Object defaultValue, String type, ParamOption[] options)
focal_class.signature:  Input(String name, Object defaultValue, String type, ParamOption[] options)
focal_class.class_method_signature: Input.Input(String name, String displayName, String type, String argument, Object defaultValue,
        ParamOption[] options, boolean hidden)
focal_class.full_signature: public  Input(String name, String displayName, String type, String argument, Object defaultValue,
        ParamOption[] options, boolean hidden)
focal_class.identifier: Input
focal_class.modifiers: public
focal_class.parameters: (String name, String displayName, String type, String argument, Object defaultValue,
        ParamOption[] options, boolean hidden)
focal_class.signature:  Input(String name, String displayName, String type, String argument, Object defaultValue,
        ParamOption[] options, boolean hidden)
focal_class.class_method_signature: Input.equals(Object o)
focal_class.full_signature: @Override public boolean equals(Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(Object o)
focal_class.class_method_signature: Input.getName()
focal_class.full_signature: public String getName()
focal_class.identifier: getName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_class.class_method_signature: Input.setName(String name)
focal_class.full_signature: public void setName(String name)
focal_class.identifier: setName
focal_class.modifiers: public
focal_class.parameters: (String name)
focal_class.return: void
focal_class.signature: void setName(String name)
focal_class.class_method_signature: Input.getDisplayName()
focal_class.full_signature: public String getDisplayName()
focal_class.identifier: getDisplayName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getDisplayName()
focal_class.class_method_signature: Input.setDisplayName(String displayName)
focal_class.full_signature: public void setDisplayName(String displayName)
focal_class.identifier: setDisplayName
focal_class.modifiers: public
focal_class.parameters: (String displayName)
focal_class.return: void
focal_class.signature: void setDisplayName(String displayName)
focal_class.class_method_signature: Input.getType()
focal_class.full_signature: public String getType()
focal_class.identifier: getType
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getType()
focal_class.class_method_signature: Input.setType(String type)
focal_class.full_signature: public void setType(String type)
focal_class.identifier: setType
focal_class.modifiers: public
focal_class.parameters: (String type)
focal_class.return: void
focal_class.signature: void setType(String type)
focal_class.class_method_signature: Input.getDefaultValue()
focal_class.full_signature: public Object getDefaultValue()
focal_class.identifier: getDefaultValue
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Object
focal_class.signature: Object getDefaultValue()
focal_class.class_method_signature: Input.setDefaultValue(Object defaultValue)
focal_class.full_signature: public void setDefaultValue(Object defaultValue)
focal_class.identifier: setDefaultValue
focal_class.modifiers: public
focal_class.parameters: (Object defaultValue)
focal_class.return: void
focal_class.signature: void setDefaultValue(Object defaultValue)
focal_class.class_method_signature: Input.getOptions()
focal_class.full_signature: public ParamOption[] getOptions()
focal_class.identifier: getOptions
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: ParamOption[]
focal_class.signature: ParamOption[] getOptions()
focal_class.class_method_signature: Input.setOptions(ParamOption[] options)
focal_class.full_signature: public void setOptions(ParamOption[] options)
focal_class.identifier: setOptions
focal_class.modifiers: public
focal_class.parameters: (ParamOption[] options)
focal_class.return: void
focal_class.signature: void setOptions(ParamOption[] options)
focal_class.class_method_signature: Input.isHidden()
focal_class.full_signature: public boolean isHidden()
focal_class.identifier: isHidden
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isHidden()
focal_class.class_method_signature: Input.getNameAndDisplayName(String str)
focal_class.full_signature: private static String[] getNameAndDisplayName(String str)
focal_class.identifier: getNameAndDisplayName
focal_class.modifiers: private static
focal_class.parameters: (String str)
focal_class.return: String[]
focal_class.signature: String[] getNameAndDisplayName(String str)
focal_class.class_method_signature: Input.getType(String str)
focal_class.full_signature: private static String[] getType(String str)
focal_class.identifier: getType
focal_class.modifiers: private static
focal_class.parameters: (String str)
focal_class.return: String[]
focal_class.signature: String[] getType(String str)
focal_class.class_method_signature: Input.getInputForm(Matcher match)
focal_class.full_signature: private static Input getInputForm(Matcher match)
focal_class.identifier: getInputForm
focal_class.modifiers: private static
focal_class.parameters: (Matcher match)
focal_class.return: Input
focal_class.signature: Input getInputForm(Matcher match)
focal_class.class_method_signature: Input.extractSimpleQueryForm(String script)
focal_class.full_signature: public static LinkedHashMap<String, Input> extractSimpleQueryForm(String script)
focal_class.identifier: extractSimpleQueryForm
focal_class.modifiers: public static
focal_class.parameters: (String script)
focal_class.return: LinkedHashMap<String, Input>
focal_class.signature: LinkedHashMap<String, Input> extractSimpleQueryForm(String script)
focal_class.class_method_signature: Input.getSimpleQuery(Map<String, Object> params, String script)
focal_class.full_signature: public static String getSimpleQuery(Map<String, Object> params, String script)
focal_class.identifier: getSimpleQuery
focal_class.modifiers: public static
focal_class.parameters: (Map<String, Object> params, String script)
focal_class.return: String
focal_class.signature: String getSimpleQuery(Map<String, Object> params, String script)
focal_class.class_method_signature: Input.split(String str)
focal_class.full_signature: public static String[] split(String str)
focal_class.identifier: split
focal_class.modifiers: public static
focal_class.parameters: (String str)
focal_class.return: String[]
focal_class.signature: String[] split(String str)
focal_class.class_method_signature: Input.splitPipe(String str)
focal_class.full_signature: public static String[] splitPipe(String str)
focal_class.identifier: splitPipe
focal_class.modifiers: public static
focal_class.parameters: (String str)
focal_class.return: String[]
focal_class.signature: String[] splitPipe(String str)
focal_class.class_method_signature: Input.split(String str, char split)
focal_class.full_signature: public static String[] split(String str, char split)
focal_class.identifier: split
focal_class.modifiers: public static
focal_class.parameters: (String str, char split)
focal_class.return: String[]
focal_class.signature: String[] split(String str, char split)
focal_class.class_method_signature: Input.split(String str, String[] splitters, boolean includeSplitter)
focal_class.full_signature: public static String[] split(String str, String[] splitters, boolean includeSplitter)
focal_class.identifier: split
focal_class.modifiers: public static
focal_class.parameters: (String str, String[] splitters, boolean includeSplitter)
focal_class.return: String[]
focal_class.signature: String[] split(String str, String[] splitters, boolean includeSplitter)
focal_class.class_method_signature: Input.split(String str, String escapeSeq, char escapeChar, String[] blockStart,
        String[] blockEnd, String[] splitters, boolean includeSplitter)
focal_class.full_signature: public static String[] split(String str, String escapeSeq, char escapeChar, String[] blockStart,
        String[] blockEnd, String[] splitters, boolean includeSplitter)
focal_class.identifier: split
focal_class.modifiers: public static
focal_class.parameters: (String str, String escapeSeq, char escapeChar, String[] blockStart,
        String[] blockEnd, String[] splitters, boolean includeSplitter)
focal_class.return: String[]
focal_class.signature: String[] split(String str, String escapeSeq, char escapeChar, String[] blockStart,
        String[] blockEnd, String[] splitters, boolean includeSplitter)
focal_class.class_method_signature: Input.getBlockStr(String blockDef)
focal_class.full_signature: private static String getBlockStr(String blockDef)
focal_class.identifier: getBlockStr
focal_class.modifiers: private static
focal_class.parameters: (String blockDef)
focal_class.return: String
focal_class.signature: String getBlockStr(String blockDef)
focal_class.class_method_signature: Input.isNestedBlock(String blockDef)
focal_class.full_signature: private static boolean isNestedBlock(String blockDef)
focal_class.identifier: isNestedBlock
focal_class.modifiers: private static
focal_class.parameters: (String blockDef)
focal_class.return: boolean
focal_class.signature: boolean isNestedBlock(String blockDef)
focal_method.body: public static LinkedHashMap<String, Input> extractSimpleQueryForm(String script) {
      LinkedHashMap<String, Input> forms = new LinkedHashMap<>();
      if (script == null) {
        return forms;
      }
      String replaced = script;
  
      Matcher match = VAR_PTN.matcher(replaced);
      while (match.find()) {
        Input form = getInputForm(match);
        forms.put(form.name, form);
      }
  
      forms.remove("pql");
      return forms;
    }
focal_method.class_method_signature: Input.extractSimpleQueryForm(String script)
focal_method.full_signature: public static LinkedHashMap<String, Input> extractSimpleQueryForm(String script)
focal_method.identifier: extractSimpleQueryForm
focal_method.invocations: matcher find getInputForm put remove
focal_method.modifiers: public static
focal_method.parameters: (String script)
focal_method.return: LinkedHashMap<String, Input>
focal_method.signature: LinkedHashMap<String, Input> extractSimpleQueryForm(String script)