[
https://issues.apache.org/jira/browse/PDFBOX-3576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15671425#comment-15671425
]
Kurt Devlin commented on PDFBOX-3576:
-------------------------------------
I'm OK with TextPosition being a final class. I think of it just like Java
String. But I think there should be the tools that let me make a copy of a
TextPostion instance or to compare two instances. I think adding getters for
any of the fields that are needed by the TextPosition constructor (along with
equals() and hashcode()) would allow this.
For our application, we are processing PDF and creating an XML representation
of it. Some of what we do may be generally applicable to PDFBox, but I'm still
trying to understand the scope of the project, so I'm not prepared to make any
suggestions for general suggestions/recommendations now. The project started
out as a proof of concept and to accelerate development time a copy of PDFBox
source was pulled in and modified as opposed to extending. I took over the
project recently and the idea of maintaining a Frankenstein version (a
combination of 1.7 and 1.8) of PDFBox as well as our own custom code is more
than I'm willing to work with. I've been working over the last month or so to
identify what is core PDFBox and what is ours and what needs to change in order
to fully factor out the forked code and switch over to PDFBox 2.0. It hasn't
been pretty.
> Add getter methods to TextPosition
> ----------------------------------
>
> Key: PDFBOX-3576
> URL: https://issues.apache.org/jira/browse/PDFBOX-3576
> Project: PDFBox
> Issue Type: Improvement
> Affects Versions: 2.0.3
> Reporter: Kurt Devlin
>
> I've inherited code in my department that created a local copy of
> TextPosition and broke it's immutability. I'm trying to refactor this code
> and use the core Apache implementation and I understand the need for
> TextPosition to be immutable, but can getters be added to provide read-only
> access to the class's fields?
> We have custom code that does comparison of endX/endY values to determine if
> there are overlapping characters and other features. In our application, we
> also have a swap feature where we need to create/clone new TextPosition
> instances with minor differences between an existing TextPosition instance.
> Since there are a lot of fields that are required by the constructor of the
> new instances, but can't be read from an existing instance, we need a way to
> access these fields.
> There probably should also be an override for equals() and hashCode().
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]