| java.lang.Object dalma.spi.UrlQueryParser
UrlQueryParser | public class UrlQueryParser (Code) | | Parses the query part of the URL.
author: Kohsuke Kawaguchi |
Constructor Summary | |
public | UrlQueryParser(String queryPart) Parses the query string.
Parameters: queryPart - string like "a=b&c=d". | public | UrlQueryParser(URI uri) Parses the query string. |
Method Summary | |
public void | addTo(Map<? super String, ? super String> map) Adds all the key/value pairs into the given map. | public String | getValue(String key) Gets the value for the specified key. | public String | getValue(String key, String defaultValue) Gets the value for the specified key. | public int | getValue(String key, int defaultValue) Gets the value for the specified key as an integer. | public boolean | has(String key) Returns true if the query has a parameter of the given name. |
UrlQueryParser | public UrlQueryParser(String queryPart)(Code) | | Parses the query string.
Parameters: queryPart - string like "a=b&c=d". May contain escape like '%8D'. |
UrlQueryParser | public UrlQueryParser(URI uri)(Code) | | Parses the query string.
Parameters: uri - URI whose query part will be parsed |
addTo | public void addTo(Map<? super String, ? super String> map)(Code) | | Adds all the key/value pairs into the given map.
|
getValue | public String getValue(String key)(Code) | | Gets the value for the specified key.
For example, if the query string was "a=b&c=d",
you get "b" from
getValue("a") .
null if the value is not found for the key. |
getValue | public String getValue(String key, String defaultValue)(Code) | | Gets the value for the specified key.
For example, if the query string was "a=b&c=d",
you get "b" from
getValue("a") .
Parameters: defaultValue - if no value was found for the given key,this value will be returned. |
getValue | public int getValue(String key, int defaultValue) throws NumberFormatException(Code) | | Gets the value for the specified key as an integer.
For example, if the query string was "a=b&c=d",
you get "b" from
getValue("a") .
Parameters: defaultValue - if no value was found for the given key,this value will be returned. throws: NumberFormatException - if the value was found but not a number. |
has | public boolean has(String key)(Code) | | Returns true if the query has a parameter of the given name.
|
|
|