[
https://issues.apache.org/jira/browse/PDFBOX-2459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14546269#comment-14546269
]
John Hewson edited comment on PDFBOX-2459 at 5/15/15 10:14 PM:
---------------------------------------------------------------
Ok, this introduces type safety for getting values from fields. Previously
getValue() returned Object which could be either a COS object, a PD object, or
a Java primitive (though most classes returned String). The caller had to know
which and cast as appropriate. This problem is solved by pushing getValue()
down to the specific non-terminal fields and replacing the unsafe top-level
getValue() method on PDField with getValueAsString() which provides automatic
conversion of field values to strings, which is what most downstream callers
wanted anyway.
was (Author: jahewson):
Ok, this introduces type safety for getting values from fields. Previously
getValue() return Object which could be either a COS object, a PD object, or a
Java primitive (though most classes returned String). The caller had to know
which and cast as appropriate. This problem is solved by pushing getValue()
down to the specific non-terminal fields and replacing the unsafe top-level
getValue() method on PDField with getValueAsString() which provides automatic
conversion of field values to strings, which is what most downstream callers
wanted anyway.
> 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: [email protected]
For additional commands, e-mail: [email protected]