Class QueryCombiner

  • All Implemented Interfaces:
    java.util.Map<java.lang.String,​java.lang.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.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      • Fields inherited from class org.simpleframework.common.parse.MapParser

        all, map
    • Constructor Summary

      Constructors 
      Constructor Description
      QueryCombiner​(java.lang.String... list)
      Constructor that allows a list of string objects to be parsed as a single parameter string.
      QueryCombiner​(Query query, java.lang.String... list)
      Constructor that allows an array of string objects to be parsed as a single parameter string.
      QueryCombiner​(Query query, Query post)
      Constructor that allows an array of string objects to be parsed as a single parameter string.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void add​(Query query)
      This method is used to insert a collection of tokens into the parsers map.
      void parse​(java.lang.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.
      private void parse​(java.lang.StringBuilder text)
      This is used to perform a parse of the form data that is in the provided string builder.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from interface org.simpleframework.http.Query

        getAll
    • Constructor Detail

      • QueryCombiner

        public QueryCombiner​(java.lang.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,
                             java.lang.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 Detail

      • parse

        public void parse​(java.lang.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​(java.lang.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