com.sapportals.wcm.util.uri

Class UriQuery

java.lang.Object
  extended by com.sapportals.wcm.util.uri.UriQuery

public final class UriQuery
extends Object

Manages query parameters for RFC 2396 URIs.

Copyright (c) SAP AG 2001-2005


Nested Class Summary
static class UriQuery.Parameter
          Keeps one query parameter.
 
Constructor Summary
UriQuery()
          Construct an empty query.
 
Method Summary
 void add(String name, String value)
          Adds a new parameter to the end of the query
 void clear()
          Remove all parameters from the query.
 UriQuery.Parameter get(int index)
          Get the Parameter at given index
 Iterator iterator()
          Get iterator to iterate over all parameters
 void remove(String name)
          Removes all occurances of parameter with given name.
 void set(List parameter)
          Sets query to given list of parameters.
 void set(String name, String value)
          Sets first occurance of parameter name to given value.
 int size()
          Return number of parameters.
 String toExternalForm()
          Convert query back to its RFC 2396 encoded form.
 String toString()
           
static UriQuery valueOf(String query)
          Get an object for manipulating the given query string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UriQuery

public UriQuery()
Construct an empty query.

Method Detail

valueOf

public static UriQuery valueOf(String query)
Get an object for manipulating the given query string. The query string is in RFC 2396 encoded form.

Parameters:
query - the query from an uri
Returns:
object to manipulate query

toString

public String toString()
Overrides:
toString in class Object

toExternalForm

public String toExternalForm()
Convert query back to its RFC 2396 encoded form.

Returns:
encoded query string

add

public void add(String name,
                String value)
Adds a new parameter to the end of the query

Parameters:
name - of parameter
value - of parameter or null if not present

remove

public void remove(String name)
Removes all occurances of parameter with given name.

Parameters:
name - to remove

clear

public void clear()
Remove all parameters from the query.


iterator

public Iterator iterator()
Get iterator to iterate over all parameters

Returns:
iterator over all UriQuery.Parameters

set

public void set(String name,
                String value)
Sets first occurance of parameter name to given value. If parameter was not part of query already, the parameter is appended to the query.

Parameters:
name - of parameter
value - of parameter or null if not present

set

public void set(List parameter)
Sets query to given list of parameters. All existing parameters will be removed.


size

public int size()
Return number of parameters.

Returns:
number of parameters

get

public UriQuery.Parameter get(int index)
                       throws IndexOutOfBoundsException
Get the Parameter at given index

Parameters:
index - of parameter to get
Returns:
Parameter at index
Throws:
IndexOutOfBoundsException - when index not available
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2014 SAP AG Complete Copyright Notice