- All Implemented Interfaces:
org.praxislive.core.protocols.SupportedTypes
SupportedTypes that can be included in the
lookup of a container. The implementation automatically searches the parent
lookup for other SupportedTypes, or otherwise a ComponentRegistry.
Results can be subject to further filtering, or additional types can be included.
The result is cached. The FilteredTypes must be reset() on hierarchy
changes, and in any circumstances where the behaviour of the filter or
additional types supplier changes.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.praxislive.core.protocols.SupportedTypes
org.praxislive.core.protocols.SupportedTypes.Result -
Method Summary
Modifier and TypeMethodDescriptionstatic FilteredTypescreate(org.praxislive.core.Container context) Create a FilteredTypes for the provided context.static FilteredTypesCreate a FilteredTypes for the provided context, additionally filtering the available types from the parent by the passed in filter.static FilteredTypescreate(org.praxislive.core.Container context, Predicate<org.praxislive.core.ComponentType> filter, Supplier<List<org.praxislive.core.ComponentType>> additional) Create a FilteredTypes for the provided context, additionally filtering the available types from the parent by the passed in filter, and adding in types from the supplied list.static FilteredTypescreate(org.praxislive.core.Container context, Predicate<org.praxislive.core.ComponentType> filter, Supplier<List<org.praxislive.core.ComponentType>> additional, boolean includeParentAdditional) Create a FilteredTypes for the provided context, additionally filtering the available types from the parent by the passed in filter, and adding in types from the supplied list.org.praxislive.core.protocols.SupportedTypes.Resultquery()voidreset()Reset and cause the result to be recalculated on the next call toquery().
-
Method Details
-
query
public org.praxislive.core.protocols.SupportedTypes.Result query()- Specified by:
queryin interfaceorg.praxislive.core.protocols.SupportedTypes
-
reset
public void reset()Reset and cause the result to be recalculated on the next call toquery(). The FilteredTypes should be reset on hierarchy changes of the container, and in any circumstances where the behaviour of the filter or additional types supplier changes. -
create
Create a FilteredTypes for the provided context. If noSupportedTypesis found in the parent lookup, then the implementation will attempt to filter theComponentRegistryresult according to the root type.- Parameters:
context- container this will be added to- Returns:
- instance
-
create
public static FilteredTypes create(org.praxislive.core.Container context, Predicate<org.praxislive.core.ComponentType> filter) Create a FilteredTypes for the provided context, additionally filtering the available types from the parent by the passed in filter.If the filter is null then a default filter will be used according to root type - see
create(org.praxislive.core.Container).- Parameters:
context- container this will be added tofilter- filtering to apply to parent result- Returns:
- instance
-
create
public static FilteredTypes create(org.praxislive.core.Container context, Predicate<org.praxislive.core.ComponentType> filter, Supplier<List<org.praxislive.core.ComponentType>> additional) Create a FilteredTypes for the provided context, additionally filtering the available types from the parent by the passed in filter, and adding in types from the supplied list.If the filter is null then a default filter will be used according to root type - see
create(org.praxislive.core.Container).- Parameters:
context- container this will be added tofilter- filtering to apply to parent resultadditional- supplier of a list of additional types- Returns:
- instance
-
create
public static FilteredTypes create(org.praxislive.core.Container context, Predicate<org.praxislive.core.ComponentType> filter, Supplier<List<org.praxislive.core.ComponentType>> additional, boolean includeParentAdditional) Create a FilteredTypes for the provided context, additionally filtering the available types from the parent by the passed in filter, and adding in types from the supplied list.The boolean flag allows to filter out additional types added by the parent, if the parent is also using an instance of FilteredTypes.
If the filter is null then a default filter will be used according to root type - see
create(org.praxislive.core.Container).- Parameters:
context- container this will be added tofilter- filtering to apply to parent resultadditional- supplier of a list of additional typesincludeParentAdditional- whether to include additional types from the parent- Returns:
- instance
-