Class TreeStatus
java.lang.Object
org.apache.pdfbox.debugger.treestatus.TreeStatus
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate TreePath
generatePath
(String pathString) Constructs TreePath from Status String.private String
generatePathString
(TreePath path) Constructs a status string from the path.private String
getObjectName
(Object treeNode) Get the object name of a tree node.getPathForString
(String statusString) Provides TreePath for a given status string.getStringForPath
(TreePath path) Provides status string for a TreePath instance.parsePathString
(String path) Parses a string and lists all the nodes.private Object
searchNode
(Object obj, String searchStr) An object is searched in the tree structure using the identifiers parsed earlier step.
-
Field Details
-
rootNode
-
-
Constructor Details
-
TreeStatus
private TreeStatus() -
TreeStatus
Constructor.- Parameters:
rootNode
- the root node of the tree which will be used to construct a treepath from a tree status string.
-
-
Method Details
-
getStringForPath
Provides status string for a TreePath instance.- Parameters:
path
- TreePath instance.- Returns:
- pathString.
-
getPathForString
Provides TreePath for a given status string. In case of invalid string returns null.- Parameters:
statusString
-- Returns:
- path.
-
generatePathString
Constructs a status string from the path.- Parameters:
path
-- Returns:
- the status string.
-
generatePath
Constructs TreePath from Status String.- Parameters:
pathString
-- Returns:
- a TreePath, or null if there is an error.
-
getObjectName
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:
IllegalArgumentException
- if there is an unknown treeNode type.
-
parsePathString
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
An object is searched in the tree structure using the identifiers parsed earlier step.- Parameters:
obj
-searchStr
-- Returns:
- the Object found or null
-