Package org.simpleframework.http.core
Class QueryCombiner
- java.lang.Object
-
- org.simpleframework.common.parse.Parser
-
- org.simpleframework.common.parse.MapParser<java.lang.String>
-
- org.simpleframework.http.parse.QueryParser
-
- org.simpleframework.http.core.QueryCombiner
-
- All Implemented Interfaces:
java.util.Map<java.lang.String,java.lang.String>
,Query
class QueryCombiner extends QueryParser
TheQueryCombimer
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 theQueryForm
can parse the list of strings as a single URL encoded parameter string. This can parse any number of parameter strings.
-
-
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 theparse(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 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
-
-
-
-
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 headerlist
- 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 headerpost
- 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 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
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
-
-