|
Project Wonder 5.0.0.8795 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecter.extensions.foundation.ERXMutableURL
public class ERXMutableURL
ERXMutableURL provides a mutable model of a URL, including support for storing relative "URLs" in addition to the traditional absolute URL provided by the core Java URL object.
| Constructor Summary | |
|---|---|
ERXMutableURL()
Constructs a blank ERXMutableURL. |
|
ERXMutableURL(String str)
Constructs an ERXMutableURL with all of the properties of the given external form of a URL. |
|
ERXMutableURL(URL url)
Constructs an ERXMutableURL with all of the properties of the given URL. |
|
| Method Summary | |
|---|---|
void |
addQueryParameter(String key,
String value)
Adds an additional query parameter to this URL. |
void |
addQueryParameters(NSDictionary<String,? extends Object> queryParameters)
Adds additional query parameters to this URL from those defined in the given NSDictionary. |
void |
addQueryParameters(String queryParameters)
Appends the query parameters of this URL with the given k=v&k2=v2 format string. |
void |
addQueryParametersMap(Map<String,String> queryParameters)
Adds additional query parameters to this URL from those defined in the given Map. |
void |
clearQueryParameters()
Clears the query parameters of this URL. |
boolean |
containsQueryParameter(String key)
Returns true if the given key is a query parameter key in this URL. |
String |
host()
Returns the host of this URL. |
boolean |
isAbsolute()
Returns true if this is an absolute URL. |
boolean |
isFullyQualified()
Returns true if there is a host defined for this URL. |
static void |
main(String[] args)
|
String |
path()
Returns the path of this URL. |
Integer |
port()
Returns the port of this URL (can be null). |
String |
protocol()
Returns the protocol of this URL. |
String |
queryParameter(String key)
Returns the first query parameter for the given key. |
Map<String,List<String>> |
queryParameters()
Returns the query parameters of this URL as a Map. |
List<String> |
queryParameters(String key)
Returns the query parameters for the given key. |
String |
queryParametersAsString()
Returns the query parameters of this URL as a String (in x=y&a=b syntax). |
protected void |
queryParametersAsString(StringBuffer sb)
|
String |
ref()
Returns the ref of this URL. |
void |
removeQueryParameter(String key)
Removes the query parameters with the given key. |
void |
removeQueryParameter(String key,
String value)
Removes the query parameter value for the given key for multivalue parameters. |
void |
setHost(String host)
Sets the host of this URL. |
void |
setPath(String path)
Sets the path of this URL. |
void |
setPort(Integer port)
Sets the port of this URL. |
void |
setProtocol(String protocol)
Sets the protocol of this URL (http, https, etc). |
void |
setQueryParameter(String key,
String value)
Sets the given query parameter to the given value. |
void |
setQueryParameters(NSDictionary<String,? extends Object> queryParameters)
Replaces the query parameters of this URL with those defined in the given NSDictionary. |
void |
setQueryParameters(String queryParameters)
Replaces the query parameters of this URL with the given k=v&k2=v2 format string. |
void |
setQueryParametersMap(Map<String,List<String>> queryParameters)
Replaces the query parameters of this URL with those defined in the given Map. |
void |
setRef(String ref)
Sets the ref of this URL (the #whatever part). |
void |
setURL(String str)
Sets the contents of this ERXMutableURL to be the same as the given URL external form. |
void |
setURL(URL url)
Sets the contents of this ERXMutableURL to be the same as the given URL. |
String |
toExternalForm()
Returns a String form of this URL. |
String |
toString()
|
URL |
toURL()
Returns a java.net.URL object of this URL (which might fail if you have a relative URL). |
Map<String,String> |
uniqueQueryParameters()
Returns the query parameters of this URL as a Map uniqued by key (which avoids multivalue properties at the expense of predictability). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ERXMutableURL()
public ERXMutableURL(URL url)
throws MalformedURLException
url - the URL to copy data from
MalformedURLException - if the URL is invalid
public ERXMutableURL(String str)
throws MalformedURLException
str - a URL external form
MalformedURLException - if the URL is invalid| Method Detail |
|---|
public void setURL(URL url)
throws MalformedURLException
url - the url to copy the contents from
MalformedURLException - if the URL is malformed
public void setURL(String str)
throws MalformedURLException
str - the external form of a URL to copy the contents from
MalformedURLException - if the external form of the URL is malformedpublic boolean isFullyQualified()
public boolean isAbsolute()
public void setProtocol(String protocol)
protocol - the new protocolpublic String protocol()
public void setHost(String host)
host - the host of this URLpublic String host()
public void setPath(String path)
path - the path of this URLpublic String path()
public void setPort(Integer port)
port - the port of this URLpublic Integer port()
public void setRef(String ref)
ref - the ref of this URL (the #whatever part)public String ref()
public void setQueryParameters(String queryParameters)
throws MalformedURLException
queryParameters - the query parameters
MalformedURLException - if the string is malformed
public void addQueryParameters(String queryParameters)
throws MalformedURLException
queryParameters - the query parameters
MalformedURLException - if the string is malformedpublic void setQueryParametersMap(Map<String,List<String>> queryParameters)
queryParameters - the new query parameterspublic void clearQueryParameters()
public void setQueryParameters(NSDictionary<String,? extends Object> queryParameters)
queryParameters - the new query parameterspublic void addQueryParameters(NSDictionary<String,? extends Object> queryParameters)
queryParameters - the new query parameterspublic void addQueryParametersMap(Map<String,String> queryParameters)
queryParameters - the new query parameters
public void addQueryParameter(String key,
String value)
key - the key of the new parametervalue - the value of the new parameterpublic boolean containsQueryParameter(String key)
key - the key of the parameter to lookup
public void removeQueryParameter(String key)
key - the key of the query parameters to remove
public void removeQueryParameter(String key,
String value)
key - the key of the query parameters to lookupvalue - the value to remove.public Map<String,List<String>> queryParameters()
public Map<String,String> uniqueQueryParameters()
public List<String> queryParameters(String key)
key - the key to lookup
public String queryParameter(String key)
key - the key to lookup
public void setQueryParameter(String key,
String value)
key - the key to setvalue - the value to set it topublic String toExternalForm()
public String queryParametersAsString()
protected void queryParametersAsString(StringBuffer sb)
public URL toURL()
throws MalformedURLException
MalformedURLException - if this URL cannot be represented as a java.net.URLpublic String toString()
toString in class Object
public static void main(String[] args)
throws MalformedURLException
MalformedURLException
|
Last updated: Fri, Jan 9, 2009 04:35 AM EST | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||