Class QuotedCSV

  • All Implemented Interfaces:
    Iterable<String>
    Direct Known Subclasses:
    QuotedQualityCSV

    public class QuotedCSV
    extends Object
    implements Iterable<String>
    Implements a quoted comma separated list of values in accordance with RFC7230. OWS is removed and quoted characters ignored for parsing.
    See Also:
    "https://tools.ietf.org/html/rfc7230#section-3.2.6", "https://tools.ietf.org/html/rfc7230#section-7"
    • Field Detail

      • _keepQuotes

        protected final boolean _keepQuotes
    • Constructor Detail

      • QuotedCSV

        public QuotedCSV​(String... values)
      • QuotedCSV

        public QuotedCSV​(boolean keepQuotes,
                         String... values)
    • Method Detail

      • addValue

        public void addValue​(String value)
        Add and parse a value string(s)
        Parameters:
        value - A value that may contain one or more Quoted CSV items.
      • parsedValue

        protected void parsedValue​(StringBuffer buffer)
        Called when a value has been parsed
        Parameters:
        buffer - Containing the trimmed value, which may be mutated
      • parsedParam

        protected void parsedParam​(StringBuffer buffer,
                                   int valueLength,
                                   int paramName,
                                   int paramValue)
        Called when a parameter has been parsed
        Parameters:
        buffer - Containing the trimmed value and all parameters, which may be mutated
        valueLength - The length of the value
        paramName - The index of the start of the parameter just parsed
        paramValue - The index of the start of the parameter value just parsed, or -1
      • size

        public int size()
      • isEmpty

        public boolean isEmpty()