对于我的应用程序需求,我需要所有动作类在每次执行动作时都执行一些操作。我创建了一个新的抽象类,它扩展了
AbstractInstallAction
类,如下所示:
public abstract class AbstractInvestigatorInstallAction extends AbstractInstallAction {
private static final long serialVersionUID = -7004320241363920697L;
@Override
public boolean install(InstallerContext context) throws UserCanceledException {
ActionReport report = investigate(context);
return onFinish(context, report);
}
public abstract ActionReport investigate(Context context);
public abstract boolean onFinish(Context context, ActionReport report);
}
现在,假设我已经创建了一个自定义动作类
BlaInvestigation
这扩展了
AbstractInvestigatorInstallAction
而不是
抽象安装操作
. 但是当我在Install4j项目中添加这两个类时,我没有看到新的action类
BLA调查
当我从
search action in custom code
,我找不到它。我是否应该直接实施
InstallAction
改为上课?创建本地AbstractInstallAction有用吗?