Class QueryCombiner

All Implemented Interfaces:
Map<String,String>, Query

class QueryCombiner extends QueryParser
The QueryCombimer is used to parse several strings as a complete URL encoded parameter string. This will do the following concatenations.
 null + "a=b&c=d&e=f" = "a=b&c=d&e=f"
 "a=b" + "e=f&g=h" = "a=b&e=f&g=h";
 "a=b&c=d&e=f" + "" = "a=b&c=d&e=f"
 
This ensures that the QueryForm can parse the list of strings as a single URL encoded parameter string. This can parse any number of parameter strings.
  • Constructor Details

    • QueryCombiner

      public QueryCombiner(String... list)
      Constructor that allows a list of string objects to be parsed as a single parameter string. This will check each string to see if it is empty, that is, is either null or the zero length string.
      Parameters:
      list - this is a list of query values to be used
    • QueryCombiner

      public QueryCombiner(Query query, String... list)
      Constructor that allows an array of string objects to be parsed as a single parameter string. This will check each string to see if it is empty, that is, is either null or the zero length string.
      Parameters:
      query - this is the query from the HTTP header
      list - this is the list of strings to be parsed
    • QueryCombiner

      public QueryCombiner(Query query, Query post)
      Constructor that allows an array of string objects to be parsed as a single parameter string. This will check each string to see if it is empty, that is, is either null or the zero length string.
      Parameters:
      query - this is the query from the HTTP header
      post - this is the query from the HTTP post body
  • Method Details

    • parse

      public void parse(String[] list)
      This will concatenate the list of parameter strings as a single parameter string, before handing it to be parsed by the parse(String) method. This method will ignore any null or zero length strings in the array.
      Parameters:
      list - this is the list of strings to be parsed
    • parse

      private void parse(StringBuilder text)
      This is used to perform a parse of the form data that is in the provided string builder. This will simply convert the data in to a string and parse it in the normal fashion.
      Parameters:
      text - this is the buffer to be converted to a string
    • add

      private void add(Query query)
      This method is used to insert a collection of tokens into the parsers map. This is used when another source of tokens is required to populate the connection currently maintained within this parsers internal map. Any tokens that currently exist with similar names will be overwritten by this.
      Parameters:
      query - this is the collection of tokens to be added