Closed pe1uca closed 1 year ago
Why not replace the else-ifs with a switch?
A little bit late to responde you @TrapinchO but: I wanted to minimize the changes so the PR is easier to process.
At a later point we can refactor for optimization, this one is focused on cleaning up the code.
A little bit late to responde you @TrapinchO but: I wanted to minimize the changes so the PR is easier to process. At a later point we can refactor for optimization, this one is focused on cleaning up the code.
just a little bit late :) that makes sense, thanks!
Heyo! I feel bad closing this PR since it was such a significant cleanup, but the DOM parser is just a lot more manageable, and has replaced the SAX parser at this point. Thank you for the effort that went in here though!
1229 needs to be merged first.
As seen in this tutorial the
characters
method of a custom handler should only append the characters being processed in that pass, the logic to update the properties of generated object should be handled in theendElement
method.This cuts down the code needed as it removed the flags that were being set in the
startElement
method.Also improves run time as it cuts down on String object creations with
new String
and concatenation.Now only special cases are handled in these two methods (
startElement
andcharacters
)Mainly the clean up of buffers and the set of tags with mixed content.