C# Class Apache.NMS.Util.URISupport

Class to provide support for Uri query parameters which uses .Net reflection to identify and set properties.
Datei anzeigen Open project: ThorTech/apache-nms Class Usage Examples

Private Properties

Property Type Description
ParseComposite void
SplitComponents String[]

Public Methods

Method Description
CheckParenthesis ( String str ) : bool
CreateCompatibleUri ( string uriString ) : Uri

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.

CreateQueryString ( StringDictionary options ) : String
CreateRemainingUri ( Uri originalUri, StringDictionary parameters ) : Uri
CreateUriWithQuery ( Uri uri, string query ) : Uri
ExtractProperties ( StringDictionary props, string prefix ) : StringDictionary
GetProperties ( StringDictionary props, string prefix ) : StringDictionary
ParseComposite ( Uri uri ) : CompositeData
ParseParameters ( Uri uri ) : StringDictionary
ParseQuery ( String query ) : StringDictionary

Parse a Uri query string of the form ?x=y&z=0 into a map of name/value pairs.

RemoveQuery ( Uri original ) : Uri
SetProperties ( object target, StringDictionary map ) : void

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.

SetProperties ( object target, StringDictionary map, string prefix ) : void

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.

StripPrefix ( String value, String prefix ) : String
UrlDecode ( String s ) : String
UrlEncode ( String s ) : String

Private Methods

Method Description
ParseComposite ( Uri uri, CompositeData rc, String ssp ) : void

SplitComponents ( String componentString ) : String[]

Method Details

CheckParenthesis() public static method

public static CheckParenthesis ( String str ) : bool
str String
return bool

CreateCompatibleUri() public static method

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.
public static CreateCompatibleUri ( string uriString ) : Uri
uriString string /// A string that could be a Composite Uri that uses syntax not compatible /// with the .NET Uri class ///
return System.Uri

CreateQueryString() public static method

public static CreateQueryString ( StringDictionary options ) : String
options System.Collections.Specialized.StringDictionary
return String

CreateRemainingUri() public static method

public static CreateRemainingUri ( Uri originalUri, StringDictionary parameters ) : Uri
originalUri System.Uri
parameters System.Collections.Specialized.StringDictionary
return System.Uri

CreateUriWithQuery() public static method

public static CreateUriWithQuery ( Uri uri, string query ) : Uri
uri System.Uri
query string
return System.Uri

ExtractProperties() public static method

public static ExtractProperties ( StringDictionary props, string prefix ) : StringDictionary
props System.Collections.Specialized.StringDictionary
prefix string
return System.Collections.Specialized.StringDictionary

GetProperties() public static method

public static GetProperties ( StringDictionary props, string prefix ) : StringDictionary
props System.Collections.Specialized.StringDictionary
prefix string
return System.Collections.Specialized.StringDictionary

ParseComposite() public static method

public static ParseComposite ( Uri uri ) : CompositeData
uri System.Uri
return CompositeData

ParseParameters() public static method

public static ParseParameters ( Uri uri ) : StringDictionary
uri System.Uri
return System.Collections.Specialized.StringDictionary

ParseQuery() public static method

Parse a Uri query string of the form ?x=y&z=0 into a map of name/value pairs.
public static ParseQuery ( String query ) : StringDictionary
query String The query string to parse. This string should not contain /// Uri escape characters.
return System.Collections.Specialized.StringDictionary

RemoveQuery() public static method

public static RemoveQuery ( Uri original ) : Uri
original System.Uri
return System.Uri

SetProperties() public static method

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.
public static SetProperties ( object target, StringDictionary map ) : void
target object The object whose properties will be set.
map System.Collections.Specialized.StringDictionary Map of key/value pairs.
return void

SetProperties() public static method

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.
public static SetProperties ( object target, StringDictionary map, string prefix ) : void
target object The object whose properties will be set.
map System.Collections.Specialized.StringDictionary Map of key/value pairs.
prefix string Key value prefix. This is prepended to the property name /// before searching for a matching key value.
return void

StripPrefix() public static method

public static StripPrefix ( String value, String prefix ) : String
value String
prefix String
return String

UrlDecode() public static method

public static UrlDecode ( String s ) : String
s String
return String

UrlEncode() public static method

public static UrlEncode ( String s ) : String
s String
return String