Interface QuerystringParser
- All Known Implementing Classes:
QuerystringToRecordParser
public interface QuerystringParser
A QuerystringParser turns a querystring into a Java Object, typically a record since parsers for them can be
auto-generated. The concrete type of the object to parse is used both for parser selection and
passed to the parser to allow for maximum flexibility. This type may be a Class<?> or a ParameterizedType.
For auto-generated record parsers, each parser is responsible for one distinct raw record class, and can handle all parameterized versions of that record.
-
Method Summary
-
Method Details
-
supportsType
Checks if this parser supports the specified type.- Parameters:
type- the type to check- Returns:
- true if supported, false if not
-
parse
Converts the querystring to an application object.- Parameters:
querystring- the querystring to convert, pre-parsed into key/value pairs by the servlet containertype- the type to parse as- Returns:
- the parsed object
- Throws:
QuerystringParsingException- on parsing errors, such as wrongly formatted fields, unknown fields, missing fields or duplicate fields
-