org.sapia.ubik.net
Class QueryString

java.lang.Object
  extended by org.sapia.ubik.net.QueryString

public class QueryString
extends java.lang.Object

This class models a query string. A query string has a format similar to the following:

   /some/path?name1=value1&name2=value2
 

Author:
Yanick Duchesne
Copyright:
Copyright © 2002-2003 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site

Constructor Summary
QueryString(java.lang.String path)
          Constructor for QueryString.
 
Method Summary
 void addParameter(java.lang.String name, java.lang.String value)
          Adds the passed in name/value pair as parameter.
 java.lang.String getParameter(java.lang.String name)
          Returns the value for the parameter with the passed in name.
 java.util.Map getParameters()
          Returns this instance's parameters.
 java.lang.String getPath()
          Returns this instance's path.
static QueryString parse(java.lang.String queryStr)
          Parses a query string and returns its object representation.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryString

public QueryString(java.lang.String path)
Constructor for QueryString. This constructor takes the path of the query string.

Parameters:
a - path
Method Detail

getPath

public java.lang.String getPath()
Returns this instance's path.

Returns:
a path.

getParameters

public java.util.Map getParameters()
Returns this instance's parameters.

Returns:
a Map containing name/value pairs.

addParameter

public void addParameter(java.lang.String name,
                         java.lang.String value)
Adds the passed in name/value pair as parameter.

Parameters:
name - an object attribute name
value - an object attribute value.

getParameter

public java.lang.String getParameter(java.lang.String name)
Returns the value for the parameter with the passed in name.

Parameters:
the - name of the parameter whose value should be returned.
Returns:
the value of the given parameter, or null if no such value exists.

parse

public static QueryString parse(java.lang.String queryStr)
Parses a query string and returns its object representation.

Returns:
a QueryString

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010 Sapia OSS. All Rights Reserved.