C# Class PhoneNumbers.BuildMetadataFromXml

Exibir arquivo Open project: naphaso/kilogram Class Usage Examples

Public Methods

Method Description
BuildCountryCodeToRegionCodeMap ( PhoneMetadataCollection metadataCollection ) : List>.Dictionary
BuildPhoneMetadataCollection ( Stream input, bool liteBuild ) : PhoneMetadataCollection
GetCountryCodeToRegionCodeMap ( String filePrefix ) : List>.Dictionary
GetDomesticCarrierCodeFormattingRuleFromElement ( System.Xml.Linq.XElement element, String nationalPrefix ) : String
GetNationalPrefix ( System.Xml.Linq.XElement element ) : String
GetNationalPrefixFormattingRuleFromElement ( System.Xml.Linq.XElement element, String nationalPrefix ) : String
IsValidNumberType ( String numberType ) : bool
LoadAvailableFormats ( PhoneMetadata metadata, System.Xml.Linq.XElement element, String nationalPrefix, String nationalPrefixFormattingRule, bool nationalPrefixOptionalWhenFormatting ) : void
LoadCountryMetadata ( String regionCode, System.Xml.Linq.XElement element, bool liteBuild ) : PhoneMetadata
LoadGeneralDesc ( PhoneMetadata metadata, System.Xml.Linq.XElement element, bool liteBuild ) : void
LoadInternationalFormat ( PhoneMetadata metadata, System.Xml.Linq.XElement numberFormatElement, String nationalFormat ) : bool
LoadNationalFormat ( PhoneMetadata metadata, System.Xml.Linq.XElement numberFormatElement, NumberFormat format ) : String
LoadTerritoryTagMetadata ( String regionCode, System.Xml.Linq.XElement element, String nationalPrefix ) : PhoneMetadata.Builder
ProcessPhoneNumberDescElement ( PhoneNumberDesc generalDesc, System.Xml.Linq.XElement countryElement, String numberType, bool liteBuild ) : PhoneNumberDesc
SetLeadingDigitsPatterns ( System.Xml.Linq.XElement numberFormatElement, NumberFormat format ) : void
ValidateRE ( String regex ) : String
ValidateRE ( String regex, bool removeWhitespace ) : String

Private Methods

Method Description
ReplaceFirst ( String input, String value, String replacement ) : String

Method Details

BuildCountryCodeToRegionCodeMap() public static method

public static BuildCountryCodeToRegionCodeMap ( PhoneMetadataCollection metadataCollection ) : List>.Dictionary
metadataCollection PhoneMetadataCollection
return List>.Dictionary

BuildPhoneMetadataCollection() public static method

public static BuildPhoneMetadataCollection ( Stream input, bool liteBuild ) : PhoneMetadataCollection
input Stream
liteBuild bool
return PhoneMetadataCollection

GetCountryCodeToRegionCodeMap() public static method

public static GetCountryCodeToRegionCodeMap ( String filePrefix ) : List>.Dictionary
filePrefix String
return List>.Dictionary

GetDomesticCarrierCodeFormattingRuleFromElement() public static method

public static GetDomesticCarrierCodeFormattingRuleFromElement ( System.Xml.Linq.XElement element, String nationalPrefix ) : String
element System.Xml.Linq.XElement
nationalPrefix String
return String

GetNationalPrefix() public static method

public static GetNationalPrefix ( System.Xml.Linq.XElement element ) : String
element System.Xml.Linq.XElement
return String

GetNationalPrefixFormattingRuleFromElement() public static method

public static GetNationalPrefixFormattingRuleFromElement ( System.Xml.Linq.XElement element, String nationalPrefix ) : String
element System.Xml.Linq.XElement
nationalPrefix String
return String

IsValidNumberType() public static method

public static IsValidNumberType ( String numberType ) : bool
numberType String
return bool

LoadAvailableFormats() public static method

public static LoadAvailableFormats ( PhoneMetadata metadata, System.Xml.Linq.XElement element, String nationalPrefix, String nationalPrefixFormattingRule, bool nationalPrefixOptionalWhenFormatting ) : void
metadata PhoneMetadata
element System.Xml.Linq.XElement
nationalPrefix String
nationalPrefixFormattingRule String
nationalPrefixOptionalWhenFormatting bool
return void

LoadCountryMetadata() public static method

public static LoadCountryMetadata ( String regionCode, System.Xml.Linq.XElement element, bool liteBuild ) : PhoneMetadata
regionCode String
element System.Xml.Linq.XElement
liteBuild bool
return PhoneMetadata

LoadGeneralDesc() public static method

public static LoadGeneralDesc ( PhoneMetadata metadata, System.Xml.Linq.XElement element, bool liteBuild ) : void
metadata PhoneMetadata
element System.Xml.Linq.XElement
liteBuild bool
return void

LoadInternationalFormat() public static method

public static LoadInternationalFormat ( PhoneMetadata metadata, System.Xml.Linq.XElement numberFormatElement, String nationalFormat ) : bool
metadata PhoneMetadata
numberFormatElement System.Xml.Linq.XElement
nationalFormat String
return bool

LoadNationalFormat() public static method

public static LoadNationalFormat ( PhoneMetadata metadata, System.Xml.Linq.XElement numberFormatElement, NumberFormat format ) : String
metadata PhoneMetadata
numberFormatElement System.Xml.Linq.XElement
format NumberFormat
return String

LoadTerritoryTagMetadata() public static method

public static LoadTerritoryTagMetadata ( String regionCode, System.Xml.Linq.XElement element, String nationalPrefix ) : PhoneMetadata.Builder
regionCode String
element System.Xml.Linq.XElement
nationalPrefix String
return PhoneMetadata.Builder

ProcessPhoneNumberDescElement() public static method

public static ProcessPhoneNumberDescElement ( PhoneNumberDesc generalDesc, System.Xml.Linq.XElement countryElement, String numberType, bool liteBuild ) : PhoneNumberDesc
generalDesc PhoneNumberDesc
countryElement System.Xml.Linq.XElement
numberType String
liteBuild bool
return PhoneNumberDesc

SetLeadingDigitsPatterns() public static method

public static SetLeadingDigitsPatterns ( System.Xml.Linq.XElement numberFormatElement, NumberFormat format ) : void
numberFormatElement System.Xml.Linq.XElement
format NumberFormat
return void

ValidateRE() public static method

public static ValidateRE ( String regex ) : String
regex String
return String

ValidateRE() public static method

public static ValidateRE ( String regex, bool removeWhitespace ) : String
regex String
removeWhitespace bool
return String