Interface ViewFactory<T extends BaseView>

Type Parameters:
T - the concrete BaseView subtype 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.

@FunctionalInterface public interface ViewFactory<T extends BaseView>
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

    Modifier and Type
    Method
    Description
    Create a new view instance.
  • Method Details

    • create

      T create()
      Create a new view instance.
      Returns:
      the newly created view, never null