Interface TypeSupplier

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@Order(0) @FunctionalInterface public interface TypeSupplier

Functional interface for component responsible for creating instances of an unknown type. Instances are utilized by TypeFactory and are inspected at runtime for discovery of the backing type (by pre-emptively calling get()). Implementations of Broadleaf that wish to introduce factory support for a new custom type, or override an existing Broadleaf supplier, should declare their own supplier to provide a custom instance.

To ensure that your TypeSupplier provides the final mapping, it must appear last to the TypeFactory. This can be achieved by giving it a lower precedence, for example:

   @Bean
   @Order(Ordered.LOWEST_PREDENCE)
   public TypeSupplier trackingSupplier() {
       return new TypeMapping(Tracking.class, MyTracking.class);
   }
 
Author:
Jeff Fischer, Phillip Verheyden (phillipuniverse)
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    get()