Class PhoneTag

java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
com.jalios.jcms.taglib.PhoneTag
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class PhoneTag extends javax.servlet.jsp.tagext.BodyTagSupport
Prints a phone number as HTML link, properly formatted with current site and logged member settings. Uses the RFC 3966 ("tel:" uri) as the anchor href, and the international format in the anchor body text.
Since:
jcms-9.0
See Also:
  • Field Summary

    Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport

    bodyContent

    Fields inherited from class javax.servlet.jsp.tagext.TagSupport

    id, pageContext

    Fields inherited from interface javax.servlet.jsp.tagext.BodyTag

    EVAL_BODY_BUFFERED, EVAL_BODY_TAG

    Fields inherited from interface javax.servlet.jsp.tagext.IterationTag

    EVAL_BODY_AGAIN

    Fields inherited from interface javax.servlet.jsp.tagext.Tag

    EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    int
     
    void
    Set the CSS class or classes to use in the generated HTML link.
    void
    setNumber(String number)
    Set the telephone number to be parsed and displayed properly for HTML output
    void
    setRegion(String region)
    Set the region that we are expecting the number to be from
    void
    Set the title to use (instead of the default value, the number being requested)

    Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport

    doInitBody, doStartTag, getBodyContent, getPreviousOut, release, setBodyContent

    Methods inherited from class javax.servlet.jsp.tagext.TagSupport

    findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface javax.servlet.jsp.tagext.Tag

    getParent, setPageContext, setParent
  • Constructor Details

    • PhoneTag

      public PhoneTag()
  • Method Details

    • setNumber

      public void setNumber(String number)
      Set the telephone number to be parsed and displayed properly for HTML output
      Parameters:
      number - a telephone number
    • setRegion

      public void setRegion(String region)
      Set the region that we are expecting the number to be from
      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.
    • setCss

      public void setCss(String css)
      Set the CSS class or classes to use in the generated HTML link.
      Parameters:
      css - one or more css classes, ignored if null or emtpy
      Since:
      jcms-10.0.2 / JCMS-6896
    • setTitle

      public void setTitle(String title)
      Set the title to use (instead of the default value, the number being requested)
      Parameters:
      title - a string to use a in title attribute of the generated link, ignored if null or emtpy
      Since:
      jcms-10.0.2 / JCMS-6895
    • doAfterBody

      public int doAfterBody() throws javax.servlet.jsp.JspException
      Specified by:
      doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
      Overrides:
      doAfterBody in class javax.servlet.jsp.tagext.BodyTagSupport
      Throws:
      javax.servlet.jsp.JspException
    • doEndTag

      public int doEndTag() throws javax.servlet.jsp.JspException
      Specified by:
      doEndTag in interface javax.servlet.jsp.tagext.Tag
      Overrides:
      doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
      Throws:
      javax.servlet.jsp.JspException