SAP NetWeaver '04

com.sapportals.wcm.util.uri
Class UriQuery

[contained in: com.sap.netweaver.bc.util.par - bc.util.public_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.util.uri.UriQuery

public final class UriQuery
extends java.lang.Object

Manages query parameters for RFC 2396 URIs.

Copyright (c) SAP AG 2001-2003


Inner Class Summary
static class UriQuery.Parameter
          Keeps one query parameter.
 
Constructor Summary
UriQuery()
          Construct an empty query.
 
Method Summary
 void add(java.lang.String name, java.lang.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
 java.util.Iterator iterator()
          Get iterator to iterate over all parameters
 void remove(java.lang.String name)
          Removes all occurances of parameter with given name.
 void set(java.util.List parameter)
          Sets query to given list of parameters.
 void set(java.lang.String name, java.lang.String value)
          Sets first occurance of parameter name to given value.
 int size()
          Return number of parameters.
 java.lang.String toExternalForm()
          Convert query back to its RFC 2396 encoded form.
 java.lang.String toString()
           
static UriQuery valueOf(java.lang.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(java.lang.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 java.lang.String toString()
Overrides:
toString in class java.lang.Object

toExternalForm

public java.lang.String toExternalForm()
Convert query back to its RFC 2396 encoded form.
Returns:
encoded query string

add

public void add(java.lang.String name,
                java.lang.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(java.lang.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 java.util.Iterator iterator()
Get iterator to iterate over all parameters
Returns:
iterator over all UriQuery.Parameters

set

public void set(java.lang.String name,
                java.lang.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(java.util.List parameter)
Sets query to given list of parameters. All existing parameters will be removed.
Parameters:
parameter - TBD: Description of the incoming method parameter

size

public int size()
Return number of parameters.
Returns:
number of parameters

get

public UriQuery.Parameter get(int index)
                       throws java.lang.IndexOutOfBoundsException
Get the Parameter at given index
Parameters:
index - of parameter to get
Returns:
Parameter at index
Throws:
java.lang.IndexOutOfBoundsException - when index not available

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.