Package de.hybris.bootstrap.xml
Class UndoableWriterWrapper
- java.lang.Object
-
- java.io.Writer
-
- de.hybris.bootstrap.xml.UndoableWriterWrapper
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.Appendable,java.lang.AutoCloseable
public class UndoableWriterWrapper extends java.io.WriterWriter 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 Summary
Constructors Constructor Description UndoableWriterWrapper(java.io.Writer writer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidcommitSavePoint()voidflush()voidmarkSavePoint()voidrestoreSavePoint()voidwrite(char[] cbuf, int off, int len)
-
-
-
Method Detail
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein classjava.io.Writer- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Specified by:
flushin classjava.io.Writer- Throws:
java.io.IOException
-
write
public void write(char[] cbuf, int off, int len) throws java.io.IOException- Specified by:
writein classjava.io.Writer- Throws:
java.io.IOException
-
markSavePoint
public void markSavePoint()
-
restoreSavePoint
public void restoreSavePoint()
-
commitSavePoint
public void commitSavePoint()
-
-