Package com.jalios.jcms.i18n
Class PhoneNumberUtil.PhoneHtmlGenerator
java.lang.Object
com.jalios.jcms.i18n.PhoneNumberUtil.PhoneHtmlGenerator
- Enclosing class:
PhoneNumberUtil
Generator of the HTML suitable to display the specified number
(with additionnal optional parameters).
Uses fluent builder pattern.
- Since:
- jcms-10.0.2
-
Constructor Summary
ConstructorsConstructorDescriptionPhoneHtmlGenerator(String number) Create a new generator for the specified number -
Method Summary
Modifier and TypeMethodDescriptionhtml()Retrieve the HTML result using current Builder values.CSS class or classes to use in the generated HTML link.withLanguage(String lang) Language in which I18Ned message should be printed.withLinkContent(String html) HTML to use as the body content of the generated link.withLinkTitle(String text) Text to use as the title attribute value of the generated link (instead of the default behavior which is to use number being called).withRegion(String region) Region of the phone number.
-
Constructor Details
-
PhoneHtmlGenerator
Create a new generator for the specified number- Parameters:
number- the telephone number to parse and display
-
-
Method Details
-
withRegion
Region of the phone number.- Parameters:
region- the ISO 3166-1 two-letter region code that denotes the region that we are expecting the number to be from. This is only used if the number being parsed is not written in international format.- Returns:
- this instance for method chaining
-
withCss
CSS class or classes to use in the generated HTML link.- Parameters:
css- one or more css classes, ignore if null or emtpy- Returns:
- this instance for method chaining
- Since:
- JCMS-6896
-
withLinkContent
HTML to use as the body content of the generated link.- Parameters:
html- some HTML (must be valid HTML for use in a <a> tag).- Returns:
- this instance for method chaining
- Since:
- JCMS-6897
-
withLinkTitle
Text to use as the title attribute value of the generated link (instead of the default behavior which is to use number being called).- Parameters:
text- some text (this text will be properly encoded for use in an HTML attribute value, don't do it yourself).- Returns:
- this instance for method chaining
- Since:
- JCMS-6895
-
withLanguage
Language in which I18Ned message should be printed.- Parameters:
lang- an ISO-639 language code- Returns:
- this instance for method chaining
- Since:
- JCMS-6895
-
html
Retrieve the HTML result using current Builder values.- Returns:
- an HTML string, never return null (empty string is returned if number was not specified)
-