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