@Test public void testNameValueListParseEscaped() { ByteSequence buf = ContentUtil.encode( "test1 = \"\\\"stuff\\\"\"; test2= \"\\\\\"; test3 = \"stuff; stuff\""); ParserCursor cursor = new ParserCursor(0, buf.length()); List<NameValuePair> params = parser.parseParameters(buf, cursor); org.junit.Assert.assertEquals(3, params.size()); org.junit.Assert.assertEquals("test1", params.get(0).getName()); org.junit.Assert.assertEquals("\"stuff\"", params.get(0).getValue()); org.junit.Assert.assertEquals("test2", params.get(1).getName()); org.junit.Assert.assertEquals("\\", params.get(1).getValue()); org.junit.Assert.assertEquals("test3", params.get(2).getName()); org.junit.Assert.assertEquals("stuff; stuff", params.get(2).getValue()); }
public List<NameValuePair> parseParameters(final ByteSequence buf, final ParserCursor cursor) { List<NameValuePair> params = new ArrayList<NameValuePair>(); skipWhiteSpace(buf, cursor); while (!cursor.atEnd()) { NameValuePair param = parseParameter(buf, cursor); params.add(param); } return params; }
RawFieldParser { public List<NameValuePair> parseParameters(final ByteSequence buf, final ParserCursor cursor) { List<NameValuePair> params = new ArrayList<NameValuePair>(); skipWhiteSpace(buf, cursor); while (!cursor.atEnd()) { NameValuePair param = parseParameter(buf, cursor); params.add(param); } return params; } }
RawFieldParser { public List<NameValuePair> parseParameters(final ByteSequence buf, final ParserCursor cursor) { List<NameValuePair> params = new ArrayList<NameValuePair>(); skipWhiteSpace(buf, cursor); while (!cursor.atEnd()) { NameValuePair param = parseParameter(buf, cursor); params.add(param); } return params; }  }
RawFieldParser { public List<NameValuePair> parseParameters(final ByteSequence buf, final ParserCursor cursor) { List<NameValuePair> params = new ArrayList<NameValuePair>(); skipWhiteSpace(buf, cursor); while (!cursor.atEnd()) { NameValuePair param = parseParameter(buf, cursor); params.add(param); } return params; }  static BitSet INIT_BITSET(int ... b); RawField parseField(final ByteSequence raw); RawBody parseRawBody(final RawField field); RawBody parseRawBody(final ByteSequence buf, final ParserCursor cursor); List<NameValuePair> parseParameters(final ByteSequence buf, final ParserCursor cursor); NameValuePair parseParameter(final ByteSequence buf, final ParserCursor cursor); String parseToken(final ByteSequence buf, final ParserCursor cursor, final BitSet delimiters); String parseValue(final ByteSequence buf, final ParserCursor cursor, final BitSet delimiters); void skipWhiteSpace(final ByteSequence buf, final ParserCursor cursor); void skipComment(final ByteSequence buf, final ParserCursor cursor); void skipAllWhiteSpace(final ByteSequence buf, final ParserCursor cursor); void copyContent(final ByteSequence buf, final ParserCursor cursor, final BitSet delimiters,
            final StringBuilder dst); void copyUnquotedContent(final ByteSequence buf, final ParserCursor cursor, final BitSet delimiters,
                            final StringBuilder dst); void copyQuotedContent(final ByteSequence buf, final ParserCursor cursor,
            final StringBuilder dst); }
RawFieldParser { public List<NameValuePair> parseParameters(final ByteSequence buf, final ParserCursor cursor) { List<NameValuePair> params = new ArrayList<NameValuePair>(); skipWhiteSpace(buf, cursor); while (!cursor.atEnd()) { NameValuePair param = parseParameter(buf, cursor); params.add(param); } return params; }  static BitSet INIT_BITSET(int ... b); RawField parseField(final ByteSequence raw); RawBody parseRawBody(final RawField field); RawBody parseRawBody(final ByteSequence buf, final ParserCursor cursor); List<NameValuePair> parseParameters(final ByteSequence buf, final ParserCursor cursor); NameValuePair parseParameter(final ByteSequence buf, final ParserCursor cursor); String parseToken(final ByteSequence buf, final ParserCursor cursor, final BitSet delimiters); String parseValue(final ByteSequence buf, final ParserCursor cursor, final BitSet delimiters); void skipWhiteSpace(final ByteSequence buf, final ParserCursor cursor); void skipComment(final ByteSequence buf, final ParserCursor cursor); void skipAllWhiteSpace(final ByteSequence buf, final ParserCursor cursor); void copyContent(final ByteSequence buf, final ParserCursor cursor, final BitSet delimiters,
            final StringBuilder dst); void copyUnquotedContent(final ByteSequence buf, final ParserCursor cursor, final BitSet delimiters,
                            final StringBuilder dst); void copyQuotedContent(final ByteSequence buf, final ParserCursor cursor,
            final StringBuilder dst); static final RawFieldParser DEFAULT; }