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

    Modifier and Type
    Method
    Description
    parse(Map<String,String> querystring, Type type)
    Converts the querystring to an application object.
    boolean
    Checks if this parser supports the specified type.
  • Method Details

    • supportsType

      boolean supportsType(Type type)
      Checks if this parser supports the specified type.
      Parameters:
      type - the type to check
      Returns:
      true if supported, false if not
    • parse

      Object parse(Map<String,String> querystring, Type type) throws QuerystringParsingException
      Converts the querystring to an application object.
      Parameters:
      querystring - the querystring to convert, pre-parsed into key/value pairs by the servlet container
      type - 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