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 FeatureTreeNodeaddChild(String nodeName)Add a child to the nodeFeatureTreeNodeaddChild(FeatureTreeNode node)FeatureTreeNodeaddMetadataChild(String nodeName)Add a child to the nodestatic FeatureTreeNodecreateRootNode(String name)booleanequals(Object obj)Map<String,String>getAttributes()List<FeatureTreeNode>getChildren()StringgetName()StringgetValue()inthashCode()booleanisMetadataNode()voidsetAttribute(String attributeName, String attributeValue)Added attribute for the nodevoidsetAttributes(Map<String,String> toSet)voidsetValue(String value)Add value to the nodeStringtoString(){ @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)
-
-