org.pdfbox.pdmodel.common
Class PDNameTreeNode
java.lang.Object
org.pdfbox.pdmodel.common.PDNameTreeNode
- COSObjectable
public class PDNameTreeNode
extends java.lang.Object
This class represends a PDF Name tree. See the PDF Reference 1.5 section 3.8.5
for more details.
PDNameTreeNode
public PDNameTreeNode(Class valueClass)
Constructor.
valueClass
- The PD Model type of object that is the value.
PDNameTreeNode
public PDNameTreeNode(COSDictionary dict,
Class valueClass)
Constructor.
dict
- The dictionary that holds the name information.valueClass
- The PD Model type of object that is the value.
convertCOSToPD
protected Object convertCOSToPD(COSBase base)
throws IOException
Method to convert the COS value in the name tree to the PD Model object. The
default implementation will simply use reflection to create the correct object
type. Subclasses can do whatever they want.
base
- The COS object to convert.
- The converted PD Model object.
createChildNode
protected PDNameTreeNode createChildNode(COSDictionary dic)
Create a child node object.
dic
- The dictionary for the child node object to refer to.
- The new child node object.
getCOSDictionary
public COSDictionary getCOSDictionary()
Convert this standard java object to a COS object.
- The cos object that matches this Java object.
getCOSObject
public COSBase getCOSObject()
Convert this standard java object to a COS object.
- getCOSObject in interface COSObjectable
- The cos object that matches this Java object.
getKids
public List getKids()
Return the children of this node. This list will contain PDNameTreeNode objects.
- The list of children or null if there are no children.
getLowerLimit
public String getLowerLimit()
Get the lowest value for a key in the name map.
- The lowest value for a key in the map.
getNames
public Map getNames()
throws IOException
This will return a map of names. The key will be a java.lang.String the value will
depend on where this class is being used.
getUpperLimit
public String getUpperLimit()
Get the highest value for a key in the name map.
- The highest value for a key in the map.
getValue
public Object getValue(String name)
throws IOException
The name to retrieve.
name
- The name in the tree.
- The value of the name in the tree.
setKids
public void setKids(List kids)
Set the children of this named tree.
kids
- The children of this named tree.
setNames
public void setNames(Map names)
Set the names of for this node. The keys should be java.lang.String and the
values must be a COSObjectable. This method will set the appropriate upper and lower
limits based on the keys in the map.
names
- The map of names to objects.