Class AbstractNode
java.lang.Object
de.hybris.platform.commons.translator.nodes.AbstractNode
- Direct Known Subclasses:
ListNode,SimpleNode,TableNode
Abstract class that is an interface for all type of nodes
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractNode(String nodeName, String nodeText) create node with name and textAbstractNode(String nodeName, String nodeText, Map generateAttributes) create node with name, text and map<String,String> -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String attributeName, String attributeValue) Add an attribute and its value to the nodes attributesvoidaddAttributes(Map<String, String> attributes) add a map of attributes to the nodes attributesvoidaddChildNode(AbstractNode child) method that add one node to child nodes collection and set its parent as this nodevoidaddChildNodes(List<AbstractNode> childNodes) method that add all nodes from collection to this node child nodes collection, and set their parents as this nodegetAttributeByName(String attributeName) returns the value of the given attributegetChildNodeByName(String nodeName) returns the node with the given name (or null, if no such code could be found)this method was created because getting class from attributes in velocity template will produce java.util.Mapbooleanchecks if the tag is open
it must be a openTag key in attributes map and the value must be truevoidsetAttributes(Map<String, String> attributes) set all attributes of this nodevoidsetChildNodes(List<AbstractNode> childNodes) set collection of contained nodesvoidsetNodeName(String nodeName) voidsetNodeText(String nodeText) voidsetParentNode(AbstractNode parentNode)
-
Field Details
-
OPEN_TAG
open tag key for attributes map- See Also:
-
-
Constructor Details
-
AbstractNode
create node with name and text- Parameters:
nodeName-nodeText-
-
AbstractNode
create node with name, text and map<String,String>- Parameters:
nodeName-nodeText-generateAttributes-
-
-
Method Details
-
getNodeName
-
setNodeName
-
getNodeText
-
setNodeText
-
getParentNode
-
setParentNode
-
getChildNodes
- Returns:
- nodes contained (children) by this node
-
getChildNodeByName
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
set collection of contained nodes- Parameters:
childNodes- The nodes to set to this node as children
-
addChildNodes
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
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
- Returns:
- a attributeName:attributValue map of all attributes of this node
-
getAttributeByName
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
set all attributes of this node- Parameters:
attributes- An attributeName:attributValue map with all attributes of this node
-
addAttributes
add a map of attributes to the nodes attributes- Parameters:
attributes- An attributeName:attributValue map that shall be added to the nodes attributes
-
addAttribute
Add an attribute and its value to the nodes attributes- Parameters:
attributeName- The name of the attributeattributeValue- The value of the attribute
-
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
-