That might work. for the validations I was talking about, I can just make it right. but for things like Javen was talking about, there might need to be a way to break out of the save, maybe a new Exception that inherits from IOException would be the best onSave doesn't catch it, but it does pass IOExceptions on to the caller.
On Sun, Oct 30, 2016 at 6:37 AM, Nick Burch <[email protected]> wrote: > On Sun, 30 Oct 2016, Mark Murphy wrote: > >> Is there a validation hook in POIXMLDocument that will allow a document to >> validate itself before it writes itself to disk? >> > > Maybe prepareForCommit() ? (Need to call superclass too!) > > Here is the use case. An XWPFDocument header or footer must contain at >> least an empty paragraph. If a header or footer is created without a >> paragraph, this hook would let me determine this, and just put one in there >> rather than generating a corrupt document. >> > > You could do it in prepareForCommit or commit of XWPFHeaderFooter > > Nick > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
