ERXMutableURL Class Reference

Collaboration diagram for ERXMutableURL:

Collaboration graph
[legend]

List of all members.

Public Member Functions

synchronized void addQueryParameter (String key, String value)
synchronized void addQueryParameters (NSDictionary< String,?extends Object > queryParameters)
synchronized void addQueryParameters (String queryParameters) throws MalformedURLException
synchronized void addQueryParametersMap (Map< String, String > queryParameters)
ERXMutableURL appendPath (String path)
synchronized void clearQueryParameters ()
synchronized boolean containsQueryParameter (String key)
 ERXMutableURL (String str) throws MalformedURLException
 ERXMutableURL (URL url) throws MalformedURLException
 ERXMutableURL ()
String host ()
boolean isAbsolute ()
boolean isFullyQualified ()
String path ()
Integer port ()
String protocol ()
synchronized String queryParameter (String key)
synchronized List< StringqueryParameters (String key)
synchronized Map< String, List
< String > > 
queryParameters ()
String queryParametersAsString ()
String ref ()
synchronized void removeQueryParameter (String key, String value)
synchronized void removeQueryParameter (String key)
void setHost (String host)
void setPath (String path)
void setPort (Integer port)
void setProtocol (String protocol)
synchronized void setQueryParameter (String key, String value)
synchronized void setQueryParameters (NSDictionary< String,?extends Object > queryParameters)
synchronized void setQueryParameters (String queryParameters) throws MalformedURLException
synchronized void setQueryParametersMap (Map< String, List< String >> queryParameters)
void setRef (String ref)
synchronized void setURL (String str) throws MalformedURLException
synchronized void setURL (URL url) throws MalformedURLException
synchronized String toExternalForm ()
String toString ()
URL toURL () throws MalformedURLException
synchronized Map< String, StringuniqueQueryParameters ()

Static Public Member Functions

static void main (String[] args) throws MalformedURLException

Protected Member Functions

void queryParametersAsString (StringBuffer sb)

Private Attributes

String _host
String _path
Integer _port
String _protocol
Map< String, List< String > > _queryParameters
String _ref


Detailed Description

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.

Author:
mschrag

Constructor & Destructor Documentation

ERXMutableURL (  ) 

Constructs a blank ERXMutableURL.

ERXMutableURL ( URL  url  )  throws MalformedURLException

Constructs an ERXMutableURL with all of the properties of the given URL.

Parameters:
url the URL to copy data from
Exceptions:
MalformedURLException if the URL is invalid

ERXMutableURL ( String  str  )  throws MalformedURLException

Constructs an ERXMutableURL with all of the properties of the given external form of a URL.

Parameters:
str a URL external form
Exceptions:
MalformedURLException if the URL is invalid


Member Function Documentation

synchronized void addQueryParameter ( String  key,
String  value 
)

Adds an additional query parameter to this URL.

Parameters:
key the key of the new parameter
value the value of the new parameter

synchronized void addQueryParameters ( NSDictionary< String,?extends Object >  queryParameters  ) 

Adds additional query parameters to this URL from those defined in the given NSDictionary.

Parameters:
queryParameters the new query parameters

synchronized void addQueryParameters ( String  queryParameters  )  throws MalformedURLException

Appends the query parameters of this URL with the given k=v&k2=v2 format string.

Parameters:
queryParameters the query parameters
Exceptions:
MalformedURLException if the string is malformed

synchronized void addQueryParametersMap ( Map< String, String queryParameters  ) 

Adds additional query parameters to this URL from those defined in the given Map.

Parameters:
queryParameters the new query parameters

ERXMutableURL appendPath ( String  path  ) 

Appends the given path to the end of the existing path.

Parameters:
path the path to append
Returns:
this

synchronized void clearQueryParameters (  ) 

Clears the query parameters of this URL.

synchronized boolean containsQueryParameter ( String  key  ) 

Returns true if the given key is a query parameter key in this URL.

Parameters:
key the key of the parameter to lookup
Returns:
true if the given key is a query parameter key in this URL

String host (  ) 

Returns the host of this URL.

Returns:
the host of this URL

boolean isAbsolute (  ) 

Returns true if this is an absolute URL.

Returns:
true if this is an absolute URL

boolean isFullyQualified (  ) 

Returns true if there is a host defined for this URL.

Returns:
true if there is a host defined for this URL

static void main ( String[]  args  )  throws MalformedURLException [static]

String path (  ) 

Returns the path of this URL.

Returns:
the path of this URL

Integer port (  ) 

Returns the port of this URL (can be null).

Returns:
the port of this URL (can be null)

String protocol (  ) 

Returns the protocol of this URL.

Returns:
the protocol of this URL

synchronized String queryParameter ( String  key  ) 

Returns the first query parameter for the given key.

Parameters:
key the key to lookup
Returns:
the first query parmeter for the given key

synchronized List<String> queryParameters ( String  key  ) 

Returns the query parameters for the given key.

Parameters:
key the key to lookup
Returns:
the query parmeters for the given key

synchronized Map<String, List<String> > queryParameters (  ) 

Returns the query parameters of this URL as a Map.

Returns:
the query parameters of this URL as a Map

void queryParametersAsString ( StringBuffer  sb  )  [protected]

String queryParametersAsString (  ) 

Returns the query parameters of this URL as a String (in x=y&a=b syntax).

Returns:
the query parameters of this URL as a String

String ref (  ) 

Returns the ref of this URL.

Returns:
the ref of this URL

synchronized void removeQueryParameter ( String  key,
String  value 
)

Removes the query parameter value for the given key for multivalue parameters.

Parameters:
key the key of the query parameters to lookup
value the value to remove.

synchronized void removeQueryParameter ( String  key  ) 

Removes the query parameters with the given key.

Parameters:
key the key of the query parameters to remove

void setHost ( String  host  ) 

Sets the host of this URL.

Parameters:
host the host of this URL

void setPath ( String  path  ) 

Sets the path of this URL.

Parameters:
path the path of this URL

void setPort ( Integer  port  ) 

Sets the port of this URL.

Parameters:
port the port of this URL

void setProtocol ( String  protocol  ) 

Sets the protocol of this URL (http, https, etc).

Parameters:
protocol the new protocol

synchronized void setQueryParameter ( String  key,
String  value 
)

Sets the given query parameter to the given value.

Parameters:
key the key to set
value the value to set it to

synchronized void setQueryParameters ( NSDictionary< String,?extends Object >  queryParameters  ) 

Replaces the query parameters of this URL with those defined in the given NSDictionary.

Parameters:
queryParameters the new query parameters

synchronized void setQueryParameters ( String  queryParameters  )  throws MalformedURLException

Replaces the query parameters of this URL with the given k=v&k2=v2 format string.

Parameters:
queryParameters the query parameters
Exceptions:
MalformedURLException if the string is malformed

synchronized void setQueryParametersMap ( Map< String, List< String >>  queryParameters  ) 

Replaces the query parameters of this URL with those defined in the given Map.

Parameters:
queryParameters the new query parameters

void setRef ( String  ref  ) 

Sets the ref of this URL (the whatever part).

Parameters:
ref the ref of this URL (the whatever part)

synchronized void setURL ( String  str  )  throws MalformedURLException

Sets the contents of this ERXMutableURL to be the same as the given URL external form.

Parameters:
str the external form of a URL to copy the contents from
Exceptions:
MalformedURLException if the external form of the URL is malformed

synchronized void setURL ( URL  url  )  throws MalformedURLException

Sets the contents of this ERXMutableURL to be the same as the given URL.

Parameters:
url the url to copy the contents from
Exceptions:
MalformedURLException if the URL is malformed

synchronized String toExternalForm (  ) 

Returns a String form of this URL.

Returns:
a String form of this URL

String toString (  ) 

URL toURL (  )  throws MalformedURLException

Returns a java.net.URL object of this URL (which might fail if you have a relative URL).

Returns:
a java.net.URL that represents this URL
Exceptions:
MalformedURLException if this URL cannot be represented as a java.net.URL

synchronized 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).

Returns:
the query parameters of this URL as a Map


Member Data Documentation

String _host [private]

String _path [private]

Integer _port [private]

String _protocol [private]

Map<String, List<String> > _queryParameters [private]

String _ref [private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:13 2012 for Project Wonder by  doxygen 1.5.8