public class CommandWrapper extends Object implements Command
A wrapper implementation of the Command
interface.
An instance of this class is initialized with another Command
object.
It implements all methods defined by the Command
interface by
delegating to the wrapped Command
object. Thus this class can serve
as a base class for command implementations that need to alter certain
behavior of other command objects.
Constructor and Description |
---|
CommandWrapper(Command wrappedCmd)
Creates a new instance of
CommandWrapper and initializes it with
the wrapped command. |
Modifier and Type | Method and Description |
---|---|
void |
execute()
Executes this command.
|
Runnable |
getGUIUpdater()
Returns the object for the updating the UI after execution of the
command.
|
Command |
getWrappedCommand()
Returns the
Command object that is wrapped by this object. |
void |
onException(Throwable t)
Notifies this command about an exception that occurred during execution.
|
void |
onFinally()
This method is called after the execution of the command.
|
public CommandWrapper(Command wrappedCmd)
CommandWrapper
and initializes it with
the wrapped command.wrappedCmd
- the wrapped command (must not be null)IllegalArgumentException
- if the wrapped command is nullpublic final Command getWrappedCommand()
Command
object that is wrapped by this object.Command
public void execute() throws Exception
public Runnable getGUIUpdater()
getGUIUpdater
in interface Command
public void onException(Throwable t)
onException
in interface Command
t
- the exceptionCopyright © 2016 The JGUIraffe Team. All rights reserved.