Class TreeStatus
- java.lang.Object
-
- org.apache.pdfbox.debugger.treestatus.TreeStatus
-
public final class TreeStatus extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ObjectrootNode
-
Constructor Summary
Constructors Modifier Constructor Description privateTreeStatus()TreeStatus(java.lang.Object rootNode)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private javax.swing.tree.TreePathgeneratePath(java.lang.String pathString)Constructs TreePath from Status String.private java.lang.StringgeneratePathString(javax.swing.tree.TreePath path)Constructs a status string from the path.private java.lang.StringgetObjectName(java.lang.Object treeNode)Get the object name of a tree node.javax.swing.tree.TreePathgetPathForString(java.lang.String statusString)Provides TreePath for a given status string.java.lang.StringgetStringForPath(javax.swing.tree.TreePath path)Provides status string for a TreePath instance.private java.util.List<java.lang.String>parsePathString(java.lang.String path)Parses a string and lists all the nodes.private java.lang.ObjectsearchNode(java.lang.Object obj, java.lang.String searchStr)An object is searched in the tree structure using the identifiers parsed earlier step.
-
-
-
Method Detail
-
getStringForPath
public java.lang.String getStringForPath(javax.swing.tree.TreePath path)
Provides status string for a TreePath instance.- Parameters:
path- TreePath instance.- Returns:
- pathString.
-
getPathForString
public javax.swing.tree.TreePath getPathForString(java.lang.String statusString)
Provides TreePath for a given status string. In case of invalid string returns null.- Parameters:
statusString- the status string of the TreePath- Returns:
- path.
-
generatePathString
private java.lang.String generatePathString(javax.swing.tree.TreePath path)
Constructs a status string from the path.- Parameters:
path-- Returns:
- the status string.
-
generatePath
private javax.swing.tree.TreePath generatePath(java.lang.String pathString)
Constructs TreePath from Status String.- Parameters:
pathString-- Returns:
- a TreePath, or null if there is an error.
-
getObjectName
private java.lang.String getObjectName(java.lang.Object treeNode)
Get the object name of a tree node. If the given node of the tree is a MapEntry, its key is used as node identifier; if it is an ArrayEntry, then its index is used as identifier.- Parameters:
treeNode- node of a tree.- Returns:
- the name of the node.
- Throws:
java.lang.IllegalArgumentException- if there is an unknown treeNode type.
-
parsePathString
private java.util.List<java.lang.String> parsePathString(java.lang.String path)
Parses a string and lists all the nodes.- Parameters:
path- a tree path.- Returns:
- a list of nodes, or null if there is an empty node.
-
searchNode
private java.lang.Object searchNode(java.lang.Object obj, java.lang.String searchStr)An object is searched in the tree structure using the identifiers parsed earlier step.- Parameters:
obj-searchStr-- Returns:
-
-