public class UndoableXMLOutputter
extends XMLOutputter
UndoableWriterWrapper instance.
UndoableXMLOutputter xout = new UndoableXMLOutputter(actualWriter);
// start undoable writing
xout.markSavePoint();
try
{
// ... write xml ...
// finally store changes
xout.commitSavePoint();
}
catch (Exception e)
{
// discard any changes and restore outputter state
xout.restoreSavePoint();
}
| Modifier and Type | Method and Description |
|---|---|
void |
commitSavePoint()
Stores all xml data which has been written since
markSavePoint() has been called to the underlying
writer. |
boolean |
hasSavePoint()
Tells whether or not undoable writing has been started or not.
|
void |
markSavePoint()
Starts undoable xml writing.
|
void |
restoreSavePoint()
Discards all xml data which has been written since
markSavePoint() has been called. |
public void markSavePoint()
commitSavePoint() or restoreSavePoint() at
the end of undoable writing period.java.lang.IllegalStateException - if called twice before either commitSavePoint() or restoreSavePoint() have been
calledpublic boolean hasSavePoint()
public void restoreSavePoint()
markSavePoint() has been called. The prevous outputter
state is restored (opened tag, indentation level, ... ).
From now on undoable writing is disabled until markSavePoint() is called again.
public void commitSavePoint()
markSavePoint() has been called to the underlying
writer.
From now on undoable writing is disabled until markSavePoint() is called again.
Copyright © 2018 SAP SE. All Rights Reserved.