Package edu.cnu.mdi.view
Interface ViewFactory<T extends BaseView>
- Type Parameters:
T- the concreteBaseViewsubtype created by this factory
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional interface used to create a view instance.
This replaces the previous reflection-based convention that required each
lazily-created view class to expose a static
construct(Object... keyVals) method.
A ViewFactory may be implemented using:
- a constructor reference, e.g.
MyView::new - a lambda, e.g.
() -> new MyView(defaultKeyVals()) - an anonymous class where older syntax is preferred
-
Method Summary
-
Method Details
-
create
T create()Create a new view instance.- Returns:
- the newly created view, never
null
-