Class Element

  • All Implemented Interfaces:
    Freezable<Node>

    public abstract class Element
    extends Node
    A page may contain any number of elements (along with arbitrary textual data and other content). Each element may also contain other elements.
    • Constructor Detail

      • Element

        public Element()
    • Method Detail

      • equals

        public boolean equals​(Object obj)
        Two elements are equal when they are the same object or when they are on the same page and have the same ID. If either one does not have a page or does not (yet) have an ID, they will not be equal.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getElementIdTemplate

        protected String getElementIdTemplate()
        Gets the element ID template for generating IDs.
        See Also:
        Defaults to getLabel()
      • getDefaultIdPrefix

        protected abstract String getDefaultIdPrefix()
        Gets the default element ID prefix for this type of element.
      • getPage

        public Page getPage()
        Every element may (and usually will) exist within a page.
      • getId

        public String getId()
        When inside a page, every element must have a per-page unique ID, when one is not provided, it will be generated. When not inside a page, no missing ID is generated and it will remain null.
      • setId

        public void setId​(String id)
      • getParentElement

        public Element getParentElement()
        Elements may be nested, gets the parent Element above this element. Top-level parents within a page, or standalone elements, will not have any parent.
      • isHidden

        public boolean isHidden()
        When hidden, an element is not added to common elements like navigation trees. By default, elements are not hidden.