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 callingget()
). 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 theTypeFactory
. 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:
TypeFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TypeSupplier.TypeMapping
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TypeSupplier.TypeMapping
get()
-
-
-
Method Detail
-
get
@NonNull TypeSupplier.TypeMapping get()
-
-