@Test public void testParsedLineIterator2() { LineParser lineParser = new LineParser(); ParsedLine line = lineParser.parseLine("foo bar"); ParsedLineIterator iterator = line.iterator(); assertEquals("foo bar", iterator.stringFromCurrentPosition()); iterator.updateIteratorPosition(3); assertEquals(' ', iterator.pollChar()); assertEquals("bar", iterator.stringFromCurrentPosition()); assertEquals("bar", iterator.pollWord()); line = lineParser.parseLine("command --opt1={ myProp1=99, myProp2=100} --opt2"); iterator = line.iterator(); assertEquals("command", iterator.pollWord()); assertEquals('-', iterator.peekChar()); assertEquals("--opt1={", iterator.peekWord()); iterator.updateIteratorPosition(33); assertEquals("--opt2", iterator.peekWord()); assertEquals(' ', iterator.peekChar()); line = lineParser.parseLine("--headers={t=x; t=y}"); iterator = line.iterator(); assertEquals("--headers={t=x;", iterator.pollWord()); assertEquals('t', iterator.peekChar()); iterator.updateIteratorPosition(3); assertEquals('}', iterator.peekChar()); assertEquals("t=y}", iterator.pollWord()); assertFalse(iterator.hasNextWord()); assertNull("", iterator.pollWord()); line = lineParser.parseLine("--headers={t=x; t=y}"); iterator = line.iterator(); iterator.pollParsedWord(); iterator.updateIteratorPosition(4); assertFalse(iterator.hasNextChar()); assertEquals('\u0000', iterator.pollChar()); assertNull("", iterator.pollWord()); line = lineParser.parseLine("--headers={t=x; t=y}"); iterator = line.iterator(); iterator.pollParsedWord(); iterator.updateIteratorPosition(40); assertFalse(iterator.hasNextChar()); assertEquals('\u0000', iterator.pollChar()); assertNull("", iterator.pollWord()); line = lineParser.parseLine("--headers={t=x; t=y}"); iterator = line.iterator(); iterator.updateIteratorPosition(20); assertNull(iterator.peekWord()); }
public ParsedLine parseLine(String text) { return parseLine(text, -1); }
LineParser { public ParsedLine parseLine(String text) { return parseLine(text, -1); } }
LineParser { public ParsedLine parseLine(String text) { return parseLine(text, -1); }  }
LineParser { public ParsedLine parseLine(String text) { return parseLine(text, -1); }  LineParser input(String text); LineParser cursor(int cursor); LineParser parseBrackets(boolean doParse); LineParser operators(EnumSet<OperatorType> operators); ParsedLine parse(); List<ParsedLine> parseWithOperators(); ParsedLine parseLine(String text); ParsedLine parseLine(String text, int cursor); ParsedLine parseLine(String text, int cursor, boolean parseCurlyAndSquareBrackets); List<ParsedLine> parseLine(String text, int cursor, boolean parseCurlyAndSquareBrackets, Set<OperatorType> operators); }
LineParser { public ParsedLine parseLine(String text) { return parseLine(text, -1); }  LineParser input(String text); LineParser cursor(int cursor); LineParser parseBrackets(boolean doParse); LineParser operators(EnumSet<OperatorType> operators); ParsedLine parse(); List<ParsedLine> parseWithOperators(); ParsedLine parseLine(String text); ParsedLine parseLine(String text, int cursor); ParsedLine parseLine(String text, int cursor, boolean parseCurlyAndSquareBrackets); List<ParsedLine> parseLine(String text, int cursor, boolean parseCurlyAndSquareBrackets, Set<OperatorType> operators);  }