The
ValueParser
is used to extract a comma separated list of HTTP header values. This will extract values without any leading or trailing spaces, which enables the values to be used. Listing the values that appear in the header also requires that the values are ordered. This orders the values using the values that appear with any quality parameter associated with it. The quality value is a special parameter that often found in a comma separated value list to specify the client preference.
image/gif, image/jpeg, text/html image/gif;q=1.0, image/jpeg;q=0.8, image/png; q=1.0,*;q=0.1 gzip;q=1.0, identity; q=0.5, *;q=0
The above lists taken from RFC 2616 provides an example of the common form comma separated values take. The first illustrates a simple comma delimited list, here the ordering of values is determined from left to right. The second and third list have quality values associated with them, these are used to specify a preference and thus order.
Each value within a list has an implicit quality value of 1.0. If the value is explicitly set with a the "q" parameter, then the values can range from 1.0 to 0.001. This parser ensures that the order of values returned from the list
method adheres to the optional quality parameters and ensures that the quality parameters a removed from the resulting text.
@author Niall Gallagher