CTX
- The context type to use, can by any Component
, service
or POJO.RET
- The return type of the Undoable
's proceedings.E
- the element typepublic abstract class AbstractUndoable<CTX,RET,E extends Exception> extends AbstractCommand<CTX,RET,E> implements Undoable<CTX,RET,E>
AbstractUndoable
implements the Undoable
interface.Constructor and Description |
---|
AbstractUndoable() |
Modifier and Type | Method and Description |
---|---|
boolean |
isUndoable(CTX aContext)
This method determines whether the
Undoable can undo the work it
has done. |
void |
undo(CTX aContext)
This method tries to undo the
Undoable in case it was
successfully executed. |
public boolean isUndoable(CTX aContext)
Undoable
can undo the work it
has done.public void undo(CTX aContext) throws NotUndoableRuntimeException, UnsupportedOperationException
Undoable
in case it was
successfully executed. Test via Undoable.isUndoable(Object)
beforehand to
see whether a call to Undoable.undo(Object)
can be applied.undo
in interface Undoable<CTX,RET,E extends Exception>
aContext
- The target object which is used by the Undoable
to do its Undoable
.NotUndoableRuntimeException
- Thrown in case the performed
operation cannot be undone, or no operation as been done before
by this Undoable
.UnsupportedOperationException
- Thrown in case the Undoable
does not provide undo facilities.Copyright © 2017. All rights reserved.