PDNameTreeNode.java (pdfbox-2.0.23-src) | : | PDNameTreeNode.java (pdfbox-2.0.24-src) | ||
---|---|---|---|---|
skipping to change at line 134 | skipping to change at line 134 | |||
} | } | |||
retval = new COSArrayList<PDNameTreeNode<T>>(pdObjects, kids); | retval = new COSArrayList<PDNameTreeNode<T>>(pdObjects, kids); | |||
} | } | |||
return retval; | return retval; | |||
} | } | |||
/** | /** | |||
* Set the children of this named tree. | * Set the children of this named tree. | |||
* | * | |||
* @param kids The children of this named tree. | * @param kids The children of this named tree. These have to be in sorted o | |||
rder. Because of | ||||
* that, it is usually easier to call {@link setNames} with a map and pass a | ||||
single element list | ||||
* here. | ||||
*/ | */ | |||
public void setKids( List<? extends PDNameTreeNode<T>> kids ) | public void setKids( List<? extends PDNameTreeNode<T>> kids ) | |||
{ | { | |||
if (kids != null && !kids.isEmpty()) | if (kids != null && !kids.isEmpty()) | |||
{ | { | |||
for (PDNameTreeNode<T> kidsNode : kids) | for (PDNameTreeNode<T> kidsNode : kids) | |||
{ | { | |||
kidsNode.setParent(this); | kidsNode.setParent(this); | |||
} | } | |||
node.setItem( COSName.KIDS, COSArrayList.converterToCOSArray( kids ) ); | node.setItem( COSName.KIDS, COSArrayList.converterToCOSArray( kids ) ); | |||
skipping to change at line 308 | skipping to change at line 310 | |||
/** | /** | |||
* Create a child node object. | * Create a child node object. | |||
* | * | |||
* @param dic The dictionary for the child node object to refer to. | * @param dic The dictionary for the child node object to refer to. | |||
* @return The new child node object. | * @return The new child node object. | |||
*/ | */ | |||
protected abstract PDNameTreeNode<T> createChildNode( COSDictionary dic ); | protected abstract PDNameTreeNode<T> createChildNode( COSDictionary dic ); | |||
/** | /** | |||
* Set the names for this node. This method will set the appropriate upper a nd lower limits | * Set the names for this node. This method will set the appropriate upper a nd lower limits | |||
* based on the keys in the map. | * based on the keys in the map and take care of the ordering. | |||
* | * | |||
* @param names map of names to objects, or <code>null</code> for nothing. | * @param names map of names to objects, or <code>null</code> for nothing. | |||
*/ | */ | |||
public void setNames( Map<String, T> names ) | public void setNames( Map<String, T> names ) | |||
{ | { | |||
if( names == null ) | if( names == null ) | |||
{ | { | |||
node.setItem( COSName.NAMES, (COSObjectable)null ); | node.setItem( COSName.NAMES, (COSObjectable)null ); | |||
node.setItem( COSName.LIMITS, (COSObjectable)null); | node.setItem( COSName.LIMITS, (COSObjectable)null); | |||
} | } | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 6 lines changed or added |