Class MenuItem


  • public class MenuItem
    extends java.lang.Object
    Represents a menu item in the portal menu structure. Each MenuItem can have child menu items, forming a tree structure.

    This class provides information about the menu item such as its page ID, parent ID, name, description, level, menu index, sub-menu index, current page ID, role, and its children. It also provides a builder for easy construction and a utility to build a tree from a flat list.

    • Constructor Summary

      Constructors 
      Constructor Description
      MenuItem​(int nPageId, int nParentId, java.lang.String strPageName, java.lang.String strPageDescription, java.lang.Integer nLevel, java.lang.Integer nMenuIndex, java.lang.Integer nSubMenuIndex, java.lang.Integer nCurrentPageId, java.lang.String strRole)
      Constructs a MenuItem with the specified properties.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static MenuItem.Builder builder()  
      java.util.List<MenuItem> getChildren()
      Gets the list of child menu items.
      java.lang.Integer getCurrentPageId()
      Gets the current page ID associated with this menu item.
      java.lang.Integer getLevel()
      Gets the level of this menu item in the menu hierarchy.
      java.lang.Integer getMenuIndex()
      Gets the index of this menu item in the menu.
      java.lang.String getPageDescription()
      Gets the description of the page for this menu item.
      int getPageId()
      Gets the page ID of this menu item.
      java.lang.String getPageName()
      Gets the name of the page for this menu item.
      int getParentId()
      Gets the parent page ID of this menu item.
      java.lang.String getRole()
      Gets the role required to view this menu item.
      java.lang.Integer getSubMenuIndex()
      Gets the index of this menu item in the submenu.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MenuItem

        public MenuItem​(int nPageId,
                        int nParentId,
                        java.lang.String strPageName,
                        java.lang.String strPageDescription,
                        java.lang.Integer nLevel,
                        java.lang.Integer nMenuIndex,
                        java.lang.Integer nSubMenuIndex,
                        java.lang.Integer nCurrentPageId,
                        java.lang.String strRole)
        Constructs a MenuItem with the specified properties.
        Parameters:
        nPageId - the page ID of the menu item
        nParentId - the parent page ID (0 if root)
        strPageName - the name of the page
        strPageDescription - the description of the page
        nLevel - the level in the menu hierarchy
        nMenuIndex - the index in the menu
        nSubMenuIndex - the index in the submenu
        nCurrentPageId - the current page ID
        strRole - the role required to view this menu item
    • Method Detail

      • getPageId

        public int getPageId()
        Gets the page ID of this menu item.
        Returns:
        the page ID
      • getParentId

        public int getParentId()
        Gets the parent page ID of this menu item.
        Returns:
        the parent page ID (0 if root)
      • getPageName

        public java.lang.String getPageName()
        Gets the name of the page for this menu item.
        Returns:
        the page name
      • getPageDescription

        public java.lang.String getPageDescription()
        Gets the description of the page for this menu item.
        Returns:
        the page description
      • getLevel

        public java.lang.Integer getLevel()
        Gets the level of this menu item in the menu hierarchy.
        Returns:
        the level (may be null)
      • getMenuIndex

        public java.lang.Integer getMenuIndex()
        Gets the index of this menu item in the menu.
        Returns:
        the menu index (may be null)
      • getSubMenuIndex

        public java.lang.Integer getSubMenuIndex()
        Gets the index of this menu item in the submenu.
        Returns:
        the submenu index (may be null)
      • getCurrentPageId

        public java.lang.Integer getCurrentPageId()
        Gets the current page ID associated with this menu item.
        Returns:
        the current page ID (may be null)
      • getRole

        public java.lang.String getRole()
        Gets the role required to view this menu item.
        Returns:
        the role string
      • getChildren

        public java.util.List<MenuItem> getChildren()
        Gets the list of child menu items.
        Returns:
        the list of children