Package org.ocpsoft.rewrite.servlet.util
Class QueryStringBuilder
java.lang.Object
org.ocpsoft.rewrite.servlet.util.QueryStringBuilder
Deprecated.
Utility for building URL query strings.
- Author:
- Lincoln Baxter, III <lincoln@ocpsoft.com>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParameter(String name, String... values) Deprecated.Add a single parameter with the given values.addParameterArrays(Map<String, String[]> params) Deprecated.Add parameters from the given map of name=value pairs.addParameterLists(Map<String, List<String>> params) Deprecated.Add parameters from the given map of name=value pairs.addParameters(String url) Deprecated.Add parameters from the given URL.static QueryStringBuildercreateFromArrays(Map<String, String[]> params) Deprecated.Build a query string from the given map of name=value pairs.static QueryStringBuildercreateFromEncoded(String parameters) Deprecated.Build a query string from the given URL.static QueryStringBuildercreateFromLists(Map<String, List<String>> params) Deprecated.Build a query string from the given map of name=value pairs.static QueryStringBuilderDeprecated.Return a new empty instance ofQueryStringBuilderdecode()Deprecated.Return a newQueryStringBuilderinstance having calledURLDecoder.decode(String, String)on each name=value pair.encode()Deprecated.Return a newQueryStringBuilderinstance having calledURLEncoder.encode(String, String)on each name=value pair.static StringextractQuery(String url) Deprecated.Get the query string portion of the given URL.getParameter(String name) Deprecated.Get the first value of given parameter name.Deprecated.Get the name, values[] map representing this query string.Deprecated.Get set of parameter names currently stored in this query string.String[]getParameterValues(String name) Deprecated.Get the array of values for a given parameter name.booleanisEmpty()Deprecated.Return true if this query string currently contains no parameters.removeParameter(String string) Deprecated.Deprecated.Convert the current parameters to a valid query string, including the leading '?' character.toString()Deprecated.
-
Constructor Details
-
QueryStringBuilder
public QueryStringBuilder()Deprecated.
-
-
Method Details
-
createNew
Deprecated.Return a new empty instance ofQueryStringBuilder -
createFromEncoded
Deprecated.Build a query string from the given URL. If a '?' character is encountered in the URL, the any characters up to and including the first '?' will be ignored. This method assumes that the given parameters have already been URL encoded. -
createFromArrays
Deprecated.Build a query string from the given map of name=value pairs. For parameters with more than one value, each value will be appended using the same name. -
createFromLists
Deprecated.Build a query string from the given map of name=value pairs. For parameters with more than one value, each value will be appended using the same name. -
extractQuery
Deprecated.Get the query string portion of the given URL. If no query string separator character '?' can be found, return the string unchanged. -
addParameters
Deprecated.Add parameters from the given URL. If a '?' character is encountered in the URL, the any characters up to and including the first '?' will be ignored. If a parameter already exists, append new values to the existing list of values for that parameter.Note: This method assumes that the given string is already URL encoded.
-
addParameter
Deprecated.Add a single parameter with the given values. -
addParameterArrays
Deprecated.Add parameters from the given map of name=value pairs. For parameters with more than one value, each value will be appended using the same name. If a parameter already exists, append new values to the existing list of values for that parameter. -
addParameterLists
Deprecated.Add parameters from the given map of name=value pairs. For parameters with more than one value, each value will be appended using the same name. If a parameter already exists, append new values to the existing list of values for that parameter. -
decode
Deprecated.Return a newQueryStringBuilderinstance having calledURLDecoder.decode(String, String)on each name=value pair. -
encode
Deprecated.Return a newQueryStringBuilderinstance having calledURLEncoder.encode(String, String)on each name=value pair. -
getParameter
Deprecated.Get the first value of given parameter name.- Returns:
- The value of the parameter, null if the parameter does not exist, or "" if the parameter exists but has no values.
-
getParameterMap
Deprecated.Get the name, values[] map representing this query string. -
getParameterNames
Deprecated.Get set of parameter names currently stored in this query string. -
getParameterValues
Deprecated.Get the array of values for a given parameter name.- Returns:
- The values of the parameter, null if the parameter does not exist.
-
isEmpty
public boolean isEmpty()Deprecated.Return true if this query string currently contains no parameters. -
removeParameter
Deprecated. -
toQueryString
Deprecated.Convert the current parameters to a valid query string, including the leading '?' character.For example, a
QueryStringBuilderwith the values [key=>value, name=>value1,value2,value3] will become:?key=value&name=value1&name=value2&name=value3
- Returns:
- If parameters exist, return a valid query string with leading '?' character. If no parameters exist, return an empty string.
-
toString
Deprecated.
-
AddressBuilderinstead. May be removed in subsequent releases.