Class AbstractNode

java.lang.Object
de.hybris.platform.commons.translator.nodes.AbstractNode
Direct Known Subclasses:
ListNode, SimpleNode, TableNode

public abstract class AbstractNode extends Object
Abstract class that is an interface for all type of nodes
  • Field Details

  • Constructor Details

    • AbstractNode

      public AbstractNode(String nodeName, String nodeText)
      create node with name and text
      Parameters:
      nodeName -
      nodeText -
    • AbstractNode

      public AbstractNode(String nodeName, String nodeText, Map generateAttributes)
      create node with name, text and map<String,String>
      Parameters:
      nodeName -
      nodeText -
      generateAttributes -
  • Method Details

    • getNodeName

      public String getNodeName()
    • setNodeName

      public void setNodeName(String nodeName)
    • getNodeText

      public String getNodeText()
    • setNodeText

      public void setNodeText(String nodeText)
    • getParentNode

      public AbstractNode getParentNode()
    • setParentNode

      public void setParentNode(AbstractNode parentNode)
    • getChildNodes

      public List<AbstractNode> getChildNodes()
      Returns:
      nodes contained (children) by this node
    • getChildNodeByName

      public AbstractNode getChildNodeByName(String nodeName)
      returns the node with the given name (or null, if no such code could be found)
      Parameters:
      nodeName - The name of the child node to search for
      Returns:
      first found node with given name, otherwise null
    • setChildNodes

      public void setChildNodes(List<AbstractNode> childNodes)
      set collection of contained nodes
      Parameters:
      childNodes - The nodes to set to this node as children
    • addChildNodes

      public void addChildNodes(List<AbstractNode> childNodes)
      method that add all nodes from collection to this node child nodes collection, and set their parents as this node
      Parameters:
      childNodes - The nodes to add to this node as children
    • addChildNode

      public void addChildNode(AbstractNode child)
      method that add one node to child nodes collection and set its parent as this node
      Parameters:
      child - The node to add to this node as child
    • getAttributes

      public Map<String,String> getAttributes()
      Returns:
      a attributeName:attributValue map of all attributes of this node
    • getAttributeByName

      public String getAttributeByName(String attributeName)
      returns the value of the given attribute
      Parameters:
      attributeName - The name of the attribute for which to the the value
      Returns:
      attribute for a given name
    • setAttributes

      public void setAttributes(Map<String,String> attributes)
      set all attributes of this node
      Parameters:
      attributes - An attributeName:attributValue map with all attributes of this node
    • addAttributes

      public void addAttributes(Map<String,String> attributes)
      add a map of attributes to the nodes attributes
      Parameters:
      attributes - An attributeName:attributValue map that shall be added to the nodes attributes
    • addAttribute

      public void addAttribute(String attributeName, String attributeValue)
      Add an attribute and its value to the nodes attributes
      Parameters:
      attributeName - The name of the attribute
      attributeValue - The value of the attribute
    • getStyleClass

      public String getStyleClass()
      this method was created because getting class from attributes in velocity template will produce java.util.Map
    • isOpenTag

      public boolean isOpenTag()
      checks if the tag is open
      it must be a openTag key in attributes map and the value must be true
      Returns:
      the openTag