Class CmsJspTagDevice

java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.opencms.jsp.CmsJspTagDevice
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 CmsJspTagDevice extends javax.servlet.jsp.tagext.BodyTagSupport
This class provides a <cms:device type="...">-Tag with the attribute type to specify the device.

Since:
8.0.0
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
    Device for output.

    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
    Close the device tag.
    int
    Decides on the base of the device selector interface whether the user's device is in the selected device types or not.
    Returns the device type.
    void
    Releases any resources we may have (or inherit).
    void
    Sets the type for the device.

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

    doAfterBody, doInitBody, getBodyContent, getPreviousOut, 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
  • Field Details

  • Constructor Details

  • Method Details

    • doEndTag

      public int doEndTag()
      Close the device tag.

      Specified by:
      doEndTag in interface javax.servlet.jsp.tagext.Tag
      Overrides:
      doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
      Returns:
      Tag.EVAL_PAGE
    • doStartTag

      public int doStartTag()
      Decides on the base of the device selector interface whether the user's device is in the selected device types or not.

      If the user's device is in the list of possible devices the content inside the tag is printed out and otherwise the content won't be printed out.

      Specified by:
      doStartTag in interface javax.servlet.jsp.tagext.Tag
      Overrides:
      doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
      Returns:
      Tag.EVAL_BODY_INCLUDE
      Tag.SKIP_BODY
    • getType

      public String getType()
      Returns the device type.

      Returns:
      the device type
    • release

      public void release()
      Releases any resources we may have (or inherit).

      Specified by:
      release in interface javax.servlet.jsp.tagext.Tag
      Overrides:
      release in class javax.servlet.jsp.tagext.BodyTagSupport
    • setType

      public void setType(String type)
      Sets the type for the device.

      Parameters:
      type - the device type