public class GenericNameTree extends Object implements IPdfNameTreeAccess
| Modifier | Constructor and Description |
|---|---|
protected |
GenericNameTree(PdfDocument pdfDoc)
Creates a name tree structure in the current document.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEntry(PdfString key,
PdfObject value)
Add an entry to the name tree.
|
protected void |
addEntry(PdfString key,
PdfObject value,
Consumer<PdfDocument> onErrorAction)
Add an entry to the name tree.
|
void |
addEntry(String key,
PdfObject value)
Add an entry to the name tree.
|
PdfDictionary |
buildTree()
Build a
PdfDictionary containing the name tree. |
PdfObject |
getEntry(PdfString key)
Retrieve an entry from the name tree.
|
PdfObject |
getEntry(String key)
Retrieve an entry from the name tree.
|
protected LinkedHashMap<PdfString,PdfObject> |
getItems() |
Set<PdfString> |
getKeys()
Retrieve the set of keys in the name tree.
|
boolean |
isModified()
Check if the tree is modified.
|
protected static LinkedHashMap<PdfString,PdfObject> |
readTree(PdfDictionary dictionary)
Read the entries in a name tree structure from a dictionary object into a linked hash map
with fixed order.
|
void |
removeEntry(PdfString key)
Remove an entry from the name tree.
|
protected void |
setItems(LinkedHashMap<PdfString,PdfObject> items) |
void |
setModified()
Sets the modified flag to true.
|
protected GenericNameTree(PdfDocument pdfDoc)
pdfDoc - the document in which the name tree livespublic void addEntry(PdfString key, PdfObject value)
key - key of the entryvalue - object to addpublic void addEntry(String key, PdfObject value)
key - key of the entryvalue - object to addpublic void removeEntry(PdfString key)
key - key of the entrypublic PdfObject getEntry(PdfString key)
getEntry in interface IPdfNameTreeAccesskey - key of entry to retrievenull if absentpublic PdfObject getEntry(String key)
getEntry in interface IPdfNameTreeAccesskey - key of entry to retrievenull if absentpublic Set<PdfString> getKeys()
IPdfNameTreeAccessgetKeys in interface IPdfNameTreeAccesspublic boolean isModified()
public void setModified()
public PdfDictionary buildTree()
PdfDictionary containing the name tree.PdfDictionary containing the name treeprotected void addEntry(PdfString key, PdfObject value, Consumer<PdfDocument> onErrorAction)
key - key of the entryvalue - object to addonErrorAction - action to perform if such entry existsprotected final void setItems(LinkedHashMap<PdfString,PdfObject> items)
protected final LinkedHashMap<PdfString,PdfObject> getItems()
protected static LinkedHashMap<PdfString,PdfObject> readTree(PdfDictionary dictionary)
dictionary - a dictionary objectCopyright © 1998–2025 Apryse Group NV. All rights reserved.