Package com.day.cq.wcm.foundation
Class Navigation.Element
- java.lang.Object
-
- com.day.cq.wcm.foundation.Navigation.Element
-
- Enclosing class:
- Navigation
public static class Navigation.Element extends java.lang.Object
Navigation element.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Navigation.Element.Type
Type of the navigation element
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Page
getPage()
Returns the underlying page.java.lang.String
getPath()
Returns the escaped path of the underlying page.java.lang.String
getRawTitle()
Returns the unescaped navigation title of the underlying page.java.lang.String
getTitle()
Returns the escaped navigation title of the underlying page.Navigation.Element.Type
getType()
Returns the element type.boolean
hasChildren()
Checks if the this element has children.boolean
isCurrent()
Checks if this element is the current one.boolean
isFirst()
Checks if this element is the first of it's siblings.boolean
isLast()
Checks if this element is the last of it's siblings.boolean
isOnTrail()
Checks if this element is on the trail.
-
-
-
Method Detail
-
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 java.lang.String 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
public java.lang.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:
Page.getNavigationTitle()
,Page.getTitle()
,Page.getName()
-
getTitle
public java.lang.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 usingStringEscapeUtils.escapeHtml4(String)
- Returns:
- the navigation title
- See Also:
Page.getNavigationTitle()
,Page.getTitle()
,Page.getName()
-
hasChildren
public boolean hasChildren()
Checks if the this element has children. Note that this is alwaystrue
forNavigation.Element.Type.NODE_OPEN
andNavigation.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.
-
-