org.jboss.portal.common.http
Class QueryStringParser

java.lang.Object
  extended by org.jboss.portal.common.http.QueryStringParser

public class QueryStringParser
extends java.lang.Object

A parser for query string for the HTTP protocol. This class is thread safe.

Version:
$Revision: 7379 $
Author:
Julien Viet

Constructor Summary
QueryStringParser()
          Creates a new parser with a decoder that will decode x-www-formurlencoded parameters with the UTF-8 charset.
QueryStringParser(CharEncoder parameterDecoder)
          Create a new parser with the specified parameter decoder.
 
Method Summary
static QueryStringParser getInstance()
           
 CharEncoder getParameterDecoder()
           
 ParameterMap parseQueryString(java.lang.String queryString)
          Parse the query string and build an unmodifiable parameter map of it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryStringParser

public QueryStringParser(CharEncoder parameterDecoder)
                  throws java.lang.IllegalArgumentException
Create a new parser with the specified parameter decoder.

Parameters:
parameterDecoder - the parameter decoder
Throws:
java.lang.IllegalArgumentException - if the decoder is null

QueryStringParser

public QueryStringParser()
Creates a new parser with a decoder that will decode x-www-formurlencoded parameters with the UTF-8 charset.

Method Detail

getInstance

public static QueryStringParser getInstance()

getParameterDecoder

public CharEncoder getParameterDecoder()

parseQueryString

public ParameterMap parseQueryString(java.lang.String queryString)
                              throws java.lang.IllegalArgumentException
Parse the query string and build an unmodifiable parameter map of it.

Parameters:
queryString - the non null query string
Returns:
a map
Throws:
java.lang.IllegalArgumentException - if the query string is null