Package org.eclipse.jetty.http
Class QuotedQualityCSV
- java.lang.Object
-
- org.eclipse.jetty.http.QuotedCSV
-
- org.eclipse.jetty.http.QuotedQualityCSV
-
public class QuotedQualityCSV extends QuotedCSV implements Iterable<String>
Implements a quoted comma separated list of quality values in accordance with RFC7230 and RFC7231. Values are returned sorted in quality order, with OWS and the quality parameters removed.- See Also:
- "https://tools.ietf.org/html/rfc7230#section-3.2.6", "https://tools.ietf.org/html/rfc7230#section-7", "https://tools.ietf.org/html/rfc7231#section-5.3.1"
-
-
Field Summary
Fields Modifier and Type Field Description static Function<String,Integer>MOST_SPECIFICFunction to apply a most specific MIME encoding secondary ordering-
Fields inherited from class org.eclipse.jetty.http.QuotedCSV
_keepQuotes, _values
-
-
Constructor Summary
Constructors Constructor Description QuotedQualityCSV()Sorts values with equal quality according to the length of the value String.QuotedQualityCSV(String[] preferredOrder)Sorts values with equal quality according to given order.QuotedQualityCSV(Function<String,Integer> secondaryOrdering)Orders values with equal quality with the given function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>getValues()Iterator<String>iterator()protected voidparsedParam(StringBuffer buffer, int valueLength, int paramName, int paramValue)Called when a parameter has been parsedprotected voidparsedValue(StringBuffer buffer)Called when a value has been parsedprotected voidsort()-
Methods inherited from class org.eclipse.jetty.http.QuotedCSV
addValue, isEmpty, size, toString, unquote
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
QuotedQualityCSV
public QuotedQualityCSV()
Sorts values with equal quality according to the length of the value String.
-
QuotedQualityCSV
public QuotedQualityCSV(String[] preferredOrder)
Sorts values with equal quality according to given order.- Parameters:
preferredOrder- Array indicating the preferred order of known values
-
-
Method Detail
-
parsedValue
protected void parsedValue(StringBuffer buffer)
Description copied from class:QuotedCSVCalled when a value has been parsed- Overrides:
parsedValuein classQuotedCSV- Parameters:
buffer- Containing the trimmed value, which may be mutated
-
parsedParam
protected void parsedParam(StringBuffer buffer, int valueLength, int paramName, int paramValue)
Description copied from class:QuotedCSVCalled when a parameter has been parsed- Overrides:
parsedParamin classQuotedCSV- Parameters:
buffer- Containing the trimmed value and all parameters, which may be mutatedvalueLength- The length of the valueparamName- The index of the start of the parameter just parsedparamValue- The index of the start of the parameter value just parsed, or -1
-
sort
protected void sort()
-
-