Class QueryStringParser
- java.lang.Object
-
- org.apache.axis2.kernel.http.util.QueryStringParser
-
public class QueryStringParser extends Object
Parser for URL query strings.
-
-
Constructor Summary
Constructors Constructor Description QueryStringParser(String queryString)
Construct a parser from the given URL query string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
Get the name of the current parameter.String
getValue()
Get the value of the current parameter.boolean
next()
Move to the next parameter in the query string.boolean
search(Collection<String> names)
Search for a parameter with a name in a given collection.
-
-
-
Constructor Detail
-
QueryStringParser
public QueryStringParser(String queryString)
Construct a parser from the given URL query string.- Parameters:
queryString
- the query string, i.e. the part of the URL starting after the '?' character
-
-
Method Detail
-
next
public boolean next()
Move to the next parameter in the query string.- Returns:
true
if a parameter has been found;false
if there are no more parameters
-
search
public boolean search(Collection<String> names)
Search for a parameter with a name in a given collection. This method iterates over the parameters until a parameter with a matching name has been found. Note that the current parameter is not considered.- Parameters:
names
-- Returns:
-
getName
public String getName()
Get the name of the current parameter. Calling this method is only allowed ifnext()
has been called previously and the result of this call wastrue
. Otherwise the result of this method is undefined.- Returns:
- the name of the current parameter
-
-