Package org.verapdf.features.tools
Class FeatureTreeNode
- java.lang.Object
-
- org.verapdf.features.tools.FeatureTreeNode
-
public final class FeatureTreeNode extends Object
Feature Tree Node for Feature Reporter- Author:
- Maksim Bezrukov
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FeatureTreeNode
addChild(String nodeName)
Add a child to the nodeFeatureTreeNode
addChild(FeatureTreeNode node)
FeatureTreeNode
addMetadataChild(String nodeName)
Add a child to the nodestatic FeatureTreeNode
createRootNode(String name)
boolean
equals(Object obj)
Map<String,String>
getAttributes()
List<FeatureTreeNode>
getChildren()
String
getName()
String
getValue()
int
hashCode()
boolean
isMetadataNode()
void
setAttribute(String attributeName, String attributeValue)
Added attribute for the nodevoid
setAttributes(Map<String,String> toSet)
void
setValue(String value)
Add value to the nodeString
toString()
{ @inheritDoc }
-
-
-
Method Detail
-
getName
public String getName()
- Returns:
- name of the node
-
getValue
public String getValue()
- Returns:
- value of the node
-
getChildren
public List<FeatureTreeNode> getChildren()
- Returns:
- list of all children nodes for this node
-
addChild
public FeatureTreeNode addChild(String nodeName) throws FeatureParsingException
Add a child to the node- Parameters:
child
- new child node for the current node- Throws:
FeatureParsingException
- occurs when child adds to node with value or if the node is a metadata node
-
addMetadataChild
public FeatureTreeNode addMetadataChild(String nodeName) throws FeatureParsingException
Add a child to the node- Parameters:
child
- new child node for the current node- Throws:
FeatureParsingException
- occurs when child adds to node with value or if the node is a metadata node
-
addChild
public FeatureTreeNode addChild(FeatureTreeNode node) throws FeatureParsingException
- Throws:
FeatureParsingException
-
setValue
public void setValue(String value) throws FeatureParsingException
Add value to the node- Parameters:
value
- value- Throws:
FeatureParsingException
- occurs when value adds to the node with childrens or if the object is a metadata node and the value is not a hex string
-
isMetadataNode
public boolean isMetadataNode()
-
getAttributes
public Map<String,String> getAttributes()
- Returns:
- Map object with keys equals to attributes names and values for them equals to attributes values
-
setAttribute
public void setAttribute(String attributeName, String attributeValue)
Added attribute for the node- Parameters:
attributeName
- name of the attributeattributeValue
- value of the attribute
-
createRootNode
public static final FeatureTreeNode createRootNode(String name)
-
-