/** * Wraps the given command in an appropriate command that will substitute the delegating wrapper for its value and * child wrappers for their corresponding values, whenever they appear in the affected objects. This implementation * returns an {@link AffectedObjectsWrappingCommand} or an {@link AffectedObjectsWrappingCommandActionDelegate}, * depending on whether the given command implements {@link CommandActionDelegate}. */ protected Command wrapCommand(Command command, Class<? extends Command> commandClass) { return command instanceof CommandActionDelegate ? new AffectedObjectsWrappingCommandActionDelegate((CommandActionDelegate)command) : new AffectedObjectsWrappingCommand(command); }