Class URISupport
Class to provide support for Uri query parameters which uses .Net reflection
to identify and set properties.
Inheritance
System.Object
URISupport
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Apache.NMS.dll
Syntax
Methods
CheckParenthesis(String)
Declaration
public static bool CheckParenthesis(string str)
Parameters
| Type |
Name |
Description |
| System.String |
str |
|
Returns
| Type |
Description |
| System.Boolean |
|
CreateCompatibleUri(String)
Given a string that could be a Composite Uri that uses syntax not compatible
with the .NET Uri class such as an ActiveMQ failover Uri formatted as
"failover://(tcp://localhost:61616)", the initial '://' must be changed
to ':(' so that the Uri class doesn't attempt to parse the '(tcp:' as
the Uri's Authority as that is not a valid host name.
Declaration
public static Uri CreateCompatibleUri(string uriString)
Parameters
| Type |
Name |
Description |
| System.String |
uriString |
A string that could be a Composite Uri that uses syntax not compatible
with the .NET Uri class
|
Returns
| Type |
Description |
| System.Uri |
|
CreateQueryString(StringDictionary)
Declaration
public static string CreateQueryString(StringDictionary options)
Parameters
| Type |
Name |
Description |
| System.Collections.Specialized.StringDictionary |
options |
|
Returns
| Type |
Description |
| System.String |
|
CreateRemainingUri(Uri, StringDictionary)
Declaration
public static Uri CreateRemainingUri(Uri originalUri, StringDictionary parameters)
Parameters
| Type |
Name |
Description |
| System.Uri |
originalUri |
|
| System.Collections.Specialized.StringDictionary |
parameters |
|
Returns
| Type |
Description |
| System.Uri |
|
CreateUriWithQuery(Uri, String)
Declaration
public static Uri CreateUriWithQuery(Uri uri, string query)
Parameters
| Type |
Name |
Description |
| System.Uri |
uri |
|
| System.String |
query |
|
Returns
| Type |
Description |
| System.Uri |
|
Declaration
public static StringDictionary ExtractProperties(StringDictionary props, string prefix)
Parameters
| Type |
Name |
Description |
| System.Collections.Specialized.StringDictionary |
props |
|
| System.String |
prefix |
|
Returns
| Type |
Description |
| System.Collections.Specialized.StringDictionary |
|
GetProperties(StringDictionary, String)
Declaration
public static StringDictionary GetProperties(StringDictionary props, string prefix)
Parameters
| Type |
Name |
Description |
| System.Collections.Specialized.StringDictionary |
props |
|
| System.String |
prefix |
|
Returns
| Type |
Description |
| System.Collections.Specialized.StringDictionary |
|
ParseComposite(Uri)
Declaration
public static URISupport.CompositeData ParseComposite(Uri uri)
Parameters
| Type |
Name |
Description |
| System.Uri |
uri |
|
Returns
ParseParameters(Uri)
Declaration
public static StringDictionary ParseParameters(Uri uri)
Parameters
| Type |
Name |
Description |
| System.Uri |
uri |
|
Returns
| Type |
Description |
| System.Collections.Specialized.StringDictionary |
|
ParseQuery(String)
Parse a Uri query string of the form ?x=y&z=0
into a map of name/value pairs.
Declaration
public static StringDictionary ParseQuery(string query)
Parameters
| Type |
Name |
Description |
| System.String |
query |
The query string to parse. This string should not contain
Uri escape characters.
|
Returns
| Type |
Description |
| System.Collections.Specialized.StringDictionary |
|
RemoveQuery(Uri)
Declaration
public static Uri RemoveQuery(Uri original)
Parameters
| Type |
Name |
Description |
| System.Uri |
original |
|
Returns
| Type |
Description |
| System.Uri |
|
SetProperties(Object, StringDictionary)
Sets the public properties of a target object using a string map.
This method uses .Net reflection to identify public properties of
the target object matching the keys from the passed map.
Declaration
public static void SetProperties(object target, StringDictionary map)
Parameters
| Type |
Name |
Description |
| System.Object |
target |
The object whose properties will be set.
|
| System.Collections.Specialized.StringDictionary |
map |
Map of key/value pairs.
|
SetProperties(Object, StringDictionary, String)
Sets the public properties of a target object using a string map.
This method uses .Net reflection to identify public properties of
the target object matching the keys from the passed map.
Declaration
public static void SetProperties(object target, StringDictionary map, string prefix)
Parameters
| Type |
Name |
Description |
| System.Object |
target |
The object whose properties will be set.
|
| System.Collections.Specialized.StringDictionary |
map |
Map of key/value pairs.
|
| System.String |
prefix |
Key value prefix. This is prepended to the property name
before searching for a matching key value.
|
StripPrefix(String, String)
Declaration
public static string StripPrefix(string value, string prefix)
Parameters
| Type |
Name |
Description |
| System.String |
value |
|
| System.String |
prefix |
|
Returns
| Type |
Description |
| System.String |
|
UrlDecode(String)
Declaration
public static string UrlDecode(string s)
Parameters
| Type |
Name |
Description |
| System.String |
s |
|
Returns
| Type |
Description |
| System.String |
|
UrlEncode(String)
Declaration
public static string UrlEncode(string s)
Parameters
| Type |
Name |
Description |
| System.String |
s |
|
Returns
| Type |
Description |
| System.String |
|