public abstract class AbstractNode extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
OPEN_TAG
open tag key for attributes map
|
| Constructor and Description |
|---|
AbstractNode(String nodeName,
String nodeText)
create node with name and text
|
AbstractNode(String nodeName,
String nodeText,
Map generateAttributes)
create node with name, text and map
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(String attributeName,
String attributeValue)
Add an attribute and its value to the nodes attributes
|
void |
addAttributes(Map<String,String> attributes)
add a map of attributes to the nodes attributes
|
void |
addChildNode(AbstractNode child)
method that add one node to child nodes collection and set its parent as this node
|
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
|
String |
getAttributeByName(String attributeName)
returns the value of the given attribute
|
Map<String,String> |
getAttributes() |
AbstractNode |
getChildNodeByName(String nodeName)
returns the node with the given name (or null, if no such code could be found)
|
List<AbstractNode> |
getChildNodes() |
String |
getNodeName() |
String |
getNodeText() |
AbstractNode |
getParentNode() |
String |
getStyleClass()
this method was created because getting class from attributes in velocity template will produce java.util.Map
|
boolean |
isOpenTag()
checks if the tag is open
it must be a openTag key in attributes map and the value must be true |
void |
setAttributes(Map<String,String> attributes)
set all attributes of this node
|
void |
setChildNodes(List<AbstractNode> childNodes)
set collection of contained nodes
|
void |
setNodeName(String nodeName) |
void |
setNodeText(String nodeText) |
void |
setParentNode(AbstractNode parentNode) |
public static final String OPEN_TAG
public AbstractNode(String nodeName, String nodeText)
nodeName - nodeText - public String getNodeName()
public void setNodeName(String nodeName)
public String getNodeText()
public void setNodeText(String nodeText)
public AbstractNode getParentNode()
public void setParentNode(AbstractNode parentNode)
public List<AbstractNode> getChildNodes()
public AbstractNode getChildNodeByName(String nodeName)
nodeName - The name of the child node to search forpublic void setChildNodes(List<AbstractNode> childNodes)
childNodes - The nodes to set to this node as childrenpublic void addChildNodes(List<AbstractNode> childNodes)
childNodes - The nodes to add to this node as childrenpublic void addChildNode(AbstractNode child)
child - The node to add to this node as childpublic Map<String,String> getAttributes()
public String getAttributeByName(String attributeName)
attributeName - The name of the attribute for which to the the valuepublic void setAttributes(Map<String,String> attributes)
attributes - An attributeName:attributValue map with all attributes of this nodepublic void addAttributes(Map<String,String> attributes)
attributes - An attributeName:attributValue map that shall be added to the nodes attributespublic void addAttribute(String attributeName, String attributeValue)
attributeName - The name of the attributeattributeValue - The value of the attributepublic String getStyleClass()
public boolean isOpenTag()
Copyright © 2017 SAP SE. All Rights Reserved.