org.apache.axis2.transport.http.util
Class QueryStringParser

java.lang.Object
  extended by org.apache.axis2.transport.http.util.QueryStringParser

public class QueryStringParser
extends Object

Parser for URL query strings.


Constructor Summary
QueryStringParser(String queryString)
          Construct a parser from the given URL query string.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 if next() has been called previously and the result of this call was true. Otherwise the result of this method is undefined.

Returns:
the name of the current parameter

getValue

public String getValue()
Get the value of the current parameter. Calling this method is only allowed if next() has been called previously and the result of this call was true. Otherwise the result of this method is undefined.

Returns:
the decoded value of the current parameter


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.