Class AbstractNodeElement

    • Field Detail

      • attributes

        protected final java.util.List<NodeAttribute> attributes
        List of attributes
      • children

        protected final java.util.List<NodeElement> children
        List of child elements
      • optional

        protected boolean optional
        Whether this element is optional
      • innerContent

        protected java.lang.String innerContent
        the inner string content
    • Constructor Detail

      • AbstractNodeElement

        public AbstractNodeElement​(NodeElement parent)
        Constructor accepting the parent of this element
        Parameters:
        parent -
    • Method Detail

      • getName

        public abstract java.lang.String getName()
        The name of the element
        Specified by:
        getName in interface NodeElement
        Returns:
        Name of the element
      • getParent

        public NodeElement getParent()
        Returns the parent of this element. May be null.
        Specified by:
        getParent in interface NodeElement
        Returns:
        parent of this element. May be null.
      • getAttributes

        public java.util.List<NodeAttribute> getAttributes()
        List of attributes of this element
        Specified by:
        getAttributes in interface NodeElement
        Returns:
        list of attributes of this element
      • getChildElements

        public java.util.List<NodeElement> getChildElements()
        Returns the list of child elements.
        Specified by:
        getChildElements in interface NodeElement
        Returns:
        the list of child elements
      • addAttribute

        public void addAttribute​(NodeAttribute attribute)
        Add an attribute
        Specified by:
        addAttribute in interface NodeElement
        Parameters:
        attribute - add an attribute
      • addChildElement

        public void addChildElement​(NodeElement childElement)
        Adds a child element.
        Specified by:
        addChildElement in interface NodeElement
        Parameters:
        childElement - adds a child element
      • isOptional

        public boolean isOptional()
        Returns true if this element is optional
        Specified by:
        isOptional in interface NodeElement
        Returns:
        true if this element is optional
      • setOptional

        public void setOptional​(boolean optional)
        Sets optional or not
        Specified by:
        setOptional in interface NodeElement
      • hasChildren

        public boolean hasChildren()
        Returns true if there is at least one child
        Specified by:
        hasChildren in interface NodeElement
        Returns:
        true if there is at least one child, otherwise false
      • getInnerContent

        public java.lang.String getInnerContent()
        The inner content of this element as string. Does not include the child elements
        Specified by:
        getInnerContent in interface NodeElement
        Returns:
        inner content of this element as string. This does not include the child elements
      • setInnerContent

        public void setInnerContent​(java.lang.String content)
        Sets the inner content of this element
        Specified by:
        setInnerContent in interface NodeElement
      • addAllFactoryConfigsAsChildElements

        public static void addAllFactoryConfigsAsChildElements​(NodeElement element,
                                                               java.lang.String name,
                                                               java.util.Collection<? extends FactoryConfiguration> factoryConfigurations)
        Helper method that adds all the FactoryConfiguration from the parameter as child elements by creating FactoryConfigurationElement for each of them
        Parameters:
        element - the element in which the child elements will be added
        name - name to be used for the child element(s)
        factoryConfigurations - the FactoryConfiguration's
      • getFQName

        public java.lang.String getFQName​(java.lang.String delimiter)
        The fully qualified name of the element. The fully qualified name of the name is the name from the root element till this element separated by the delimiter string
        Specified by:
        getFQName in interface NodeElement
        Returns:
        the fully qualified name of this element separated by delimiter
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object