[ https://issues.apache.org/jira/browse/PDFBOX-2459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14546901#comment-14546901 ]
John Hewson commented on PDFBOX-2459: ------------------------------------- Actually my versions of getValue() and setValue() _are_ symmetric_: getValue() returns the value at _one_ specific node and setValue() sets the value at _one_ node. This is simple and consistent. However, your versions are _not_ symmetric, because your getValue() returns the value at _one_ specific node, yet your setValue() sets the value at some arbitrary ancestor, which has the affect of modifying the value for all descendant fields. This is complex and requires the user to have a deep knowledge of the inheritance structure of a given form to understand what setValue() will actually do. In summary, under my scheme {{field.setValue("foo")}} will set the given field's value. Under your scheme it might set the given field's value, or it might set the value of the field's siblings or it might set the value of the field's cousins, or its second cousins... etc. So your setValue() is completely inconsistent. That's because your trying to reverse the inheritance hierarchy, which just can't work. > Share functionality between Page Tree and Field Tree > ---------------------------------------------------- > > Key: PDFBOX-2459 > URL: https://issues.apache.org/jira/browse/PDFBOX-2459 > Project: PDFBox > Issue Type: Improvement > Components: PDModel > Affects Versions: 2.0.0 > Reporter: Maruan Sahyoun > Assignee: John Hewson > Priority: Minor > Fix For: 2.0.0 > > Attachments: 001511.pdf, 004324.pdf > > > The PDFs page tree and AcroForms field tree share some common functionality > e.g. resolving inheritable attributes, iterating through leafs and such which > could be combined into a PDTree class. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org