public interface JStachioExtensions
A container that will hold all resolved
JStachioExtension
s and consolidate them
to a single instances of various services.- Author:
- agentgt
- API Note
- While this interface looks similar to
JStachioExtension
it is not an extension but rather an immutable bean like container. The methods are purposely java bean style (which is not the default in JStachio as JStachio prefers newer record like accessor method names) to support as many frameworks as possible.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A marker interface used for JStachio implementations that provide access to extensions. -
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends JStachioExtension>
Optional<T>findExtension
(Class<T> c) Finds a specific implementation usingClass.isAssignableFrom(Class)
.Composite ConfigServicesComposite FilterComposite Template finderstatic JStachioExtensions
of
(Iterable<JStachioExtension> extensions) Resolve from an iterable of extensions that usually come from some discovery mechanism like theServiceLoader
or a DI framework.
-
Method Details
-
of
Resolve from an iterable of extensions that usually come from some discovery mechanism like theServiceLoader
or a DI framework.- Parameters:
extensions
- found extensions.- Returns:
- bean like container of services.
-
getConfig
Composite Config- Returns:
- config
-
getFilter
Composite Filter- Returns:
- filter
-
getTemplateFinder
Composite Template finder- Returns:
- template finder
-
getExtensions
Services- Returns:
- found services
-
findExtension
Finds a specific implementation usingClass.isAssignableFrom(Class)
.- Type Parameters:
T
- the implementation type- Parameters:
c
- the implementation type.- Returns:
- an implementation if found
-