该抽象类我有如何使用构建器模式构建抽象类?
public abstract class AbstractActionModel implements IActionModel{
public abstract void getModel();
public abstract void getAction();
}
然后,我想用这个抽象类象下面这样:
this.getActions().put("sth", AbstractActionModel.builder().action("sth").build());
既然不能实例化一个抽象类生成器模式不会干活不要”不知道这样做的任何替代模式。
注意:我也没有从这个基类扩展类的知识。
你想如何选择要创建哪个具体的子类? – DNA 2015-03-02 13:05:12
看看这里http://stackoverflow.com/questions/25909701/generic-builder-pattern-class-using-reflection – user902383 2015-03-02 13:06:37