Package com.day.cq.wcm.foundation
Class Navigation.Element
java.lang.Object
com.day.cq.wcm.foundation.Navigation.Element
- Enclosing class:
Navigation
Navigation element.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumType of the navigation element -
Method Summary
Modifier and TypeMethodDescriptiongetPage()Returns the underlying page.getPath()Returns the escaped path of the underlying page.Returns the unescaped navigation title of the underlying page.getTitle()Returns the escaped navigation title of the underlying page.getType()Returns the element type.booleanChecks if the this element has children.booleanChecks if this element is the current one.booleanisFirst()Checks if this element is the first of it's siblings.booleanisLast()Checks if this element is the last of it's siblings.booleanChecks if this element is on the trail.
-
Method Details
-
getType
Returns the element type.- Returns:
- the element type.
-
getPage
Returns the underlying page.- Returns:
- the underlying page.
-
getPath
Returns the escaped path of the underlying page. Node that the path is escaped usingText.escape(String, char, boolean)- Returns:
- the escaped path.
-
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
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 usingStringEscapeUtils.escapeHtml4(String)- Returns:
- the navigation title
- See Also:
-
hasChildren
public boolean hasChildren()Checks if the this element has children. Note that this is alwaystrueforNavigation.Element.Type.NODE_OPENandNavigation.Element.Type.NODE_CLOSEelements.- Returns:
trueif 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:
trueif 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:
trueif this element is the current one.
-
isFirst
public boolean isFirst()Checks if this element is the first of it's siblings.- Returns:
trueif 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:
trueif this element is the last of it's siblings.
-