Class Navigation.Element

java.lang.Object
com.day.cq.wcm.foundation.Navigation.Element
Enclosing class:
Navigation

public static class Navigation.Element extends Object
Navigation element.
  • Method Details

    • getType

      public Navigation.Element.Type getType()
      Returns the element type.
      Returns:
      the element type.
    • getPage

      public Page getPage()
      Returns the underlying page.
      Returns:
      the underlying page.
    • getPath

      public String getPath()
      Returns the escaped path of the underlying page. Node that the path is escaped using Text.escape(String, char, boolean)
      Returns:
      the escaped path.
    • getRawTitle

      public String getRawTitle()
      Returns the unescaped navigation title of the underlying page. if the page does not specific a navigation title, the title is used and ultimately it's name.
      Returns:
      the navigation title
      See Also:
    • getTitle

      public String getTitle()
      Returns the escaped navigation title of the underlying page. if the page does not specific a navigation title, the title is used and ultimately it's name. Note that the title is escaped using StringEscapeUtils.escapeHtml4(String)
      Returns:
      the navigation title
      See Also:
    • hasChildren

      public boolean hasChildren()
      Checks if the this element has children. Note that this is always true for Navigation.Element.Type.NODE_OPEN and Navigation.Element.Type.NODE_CLOSE elements.
      Returns:
      true if the current element has children.
    • isOnTrail

      public boolean isOnTrail()
      Checks if this element is on the trail. i.e. if the underlying page is the same or an ancestor of any degree of the current page, passed in the constructor of the navigation object.
      Returns:
      true if this element is on the trail.
    • isCurrent

      public boolean isCurrent()
      Checks if this element is the current one. i.e. if the underlying page is the same as current one, passed in the constructor of the navigation object.
      Returns:
      true if this element is the current one.
    • isFirst

      public boolean isFirst()
      Checks if this element is the first of it's siblings.
      Returns:
      true if this element is the first of it's siblings.
    • isLast

      public boolean isLast()
      Checks if this element is the last of it's siblings.
      Returns:
      true if this element is the last of it's siblings.