Package de.hybris.bootstrap.xml
Class UndoableWriterWrapper
java.lang.Object
java.io.Writer
de.hybris.bootstrap.xml.UndoableWriterWrapper
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
Writer wrapper implementation which allows to write a certain amount of (string) data and removing it
afterwards from the output.
UndoableWriterWrapper wr = new UndoableWriterWrapper(actualWriter);
// start undoable writing
wr.markSavePoint();
try
{
// ... write into wrapper ...
// finally store changes
wr.commitSavePoint();
}
catch (Exception e)
{
// discard any changes
wr.restoreSavePoint();
}
-
Constructor Details
-
UndoableWriterWrapper
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
write
- Specified by:
writein classWriter- Throws:
IOException
-
markSavePoint
public void markSavePoint() -
restoreSavePoint
public void restoreSavePoint() -
commitSavePoint
public void commitSavePoint()
-