Top Fields Constructors Methods
org.apache.pdfbox.debugger.treestatus

public final Class TreeStatus

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List, javax.swing.tree.TreePath, org.apache.pdfbox.cos.COSArray, .COSDictionary, .COSName, .COSObject, org.apache.pdfbox.debugger.ui.ArrayEntry, .MapEntry, .PageEntry, .XrefEntry

Author
Khyrul Bashar

Field Summary

Modifier and TypeField and Description
private Object

Constructor Summary

AccessConstructor and Description
private
public
TreeStatus(Object
the root node of the tree which will be used to construct a treepath from a tree status string.
rootNode
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
private TreePath

Returns:

a TreePath, or null if there is an error.
generatePath
(String pathString)

Constructs TreePath from Status String.

private String

Returns:

the status string.
generatePathString
(TreePath path)

Constructs a status string from the path.

private String

Returns:

the name of the node.
getObjectName
(Object
node of a tree.
treeNode
)

Get the object name of a tree node.

public TreePath

Returns:

path.
getPathForString
(String
the status string of the TreePath
statusString
)

Provides TreePath for a given status string.

public String

Returns:

pathString.
getStringForPath
(TreePath
TreePath instance.
path
)

Provides status string for a TreePath instance.

private List<String>

Returns:

a list of nodes, or null if there is an empty node.
parsePathString
(String
a tree path.
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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

rootNodeback to summary
private Object rootNode

Constructor Detail

TreeStatusback to summary
private TreeStatus()
TreeStatusback to summary
public TreeStatus(Object rootNode)

Constructor.

Parameters
rootNode:Object

the root node of the tree which will be used to construct a treepath from a tree status string.

Method Detail

generatePathback to summary
private TreePath generatePath(String pathString)

Constructs TreePath from Status String.

Returns:TreePath

a TreePath, or null if there is an error.

generatePathStringback to summary
private String generatePathString(TreePath path)

Constructs a status string from the path.

Returns:String

the status string.

getObjectNameback to summary
private String getObjectName(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:Object

node of a tree.

Returns:String

the name of the node.

Exceptions
IllegalArgumentException:
if there is an unknown treeNode type.
getPathForStringback to summary
public TreePath getPathForString(String statusString)

Provides TreePath for a given status string. In case of invalid string returns null.

Parameters
statusString:String

the status string of the TreePath

Returns:TreePath

path.

getStringForPathback to summary
public String getStringForPath(TreePath path)

Provides status string for a TreePath instance.

Parameters
path:TreePath

TreePath instance.

Returns:String

pathString.

parsePathStringback to summary
private List<String> parsePathString(String path)

Parses a string and lists all the nodes.

Parameters
path:String

a tree path.

Returns:List<String>

a list of nodes, or null if there is an empty node.

searchNodeback to summary
private Object searchNode(Object obj, String searchStr)

An object is searched in the tree structure using the identifiers parsed earlier step.