When extending AbstractProcessor
, there is a possibility to override init(...)
, but there is no "opposite" method, which would be called after all rounds were processed.
This is a problem: when you have to append information collected during each round to same file, you just can't ever close the file, because you never get to know when the last round was. So, the file is never closed and remains empty.
Using a shutdown hook doesn't work either, the hook is never called.
Any ideas?
The Processor.process
method includes an argument of type RoundEnvironment
. Perhaps the RoundEnvironment.processingOver
method can be of help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With