Package org.simpleframework.http.core
Class QueryCombiner
java.lang.Object
org.simpleframework.common.parse.Parser
org.simpleframework.common.parse.MapParser<String>
org.simpleframework.http.parse.QueryParser
org.simpleframework.http.core.QueryCombiner
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
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionQueryCombiner
(String... list) Constructor that allows a list of string objects to be parsed as a single parameter string.QueryCombiner
(Query query, 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
Modifier and TypeMethodDescriptionprivate void
This method is used to insert a collection of tokens into the parsers map.void
This will concatenate the list of parameter strings as a single parameter string, before handing it to be parsed by theparse(String)
method.private void
parse
(StringBuilder text) This is used to perform a parse of the form data that is in the provided string builder.Methods inherited from class org.simpleframework.http.parse.QueryParser
getBoolean, getFloat, getInteger, init, parse, toString, toString
Methods inherited from class org.simpleframework.common.parse.MapParser
clear, containsKey, containsValue, entrySet, get, getAll, isEmpty, keySet, put, putAll, remove, size, values
Methods inherited from class org.simpleframework.common.parse.Parser
digit, ensureCapacity, parse, skip, space, toLower
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
-
Constructor Details
-
QueryCombiner
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
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 headerlist
- this is the list of strings to be parsed
-
QueryCombiner
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 headerpost
- this is the query from the HTTP post body
-
-
Method Details
-
parse
This will concatenate the list of parameter strings as a single parameter string, before handing it to be parsed by theparse(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
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
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
-