Package io.jmix.flowui.model
Interface InstanceLoader<E>
- All Superinterfaces:
- DataLoader
- All Known Implementing Classes:
- InstanceLoaderImpl
Loader of a single entity instance.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic classEvent sent after successful loading of an entity instance, merging it intoDataContextand setting to the container.static classEvent sent before loading an entity instance.
- 
Method SummaryModifier and TypeMethodDescriptionaddPostLoadListener(Consumer<InstanceLoader.PostLoadEvent<E>> listener) Adds a listener toInstanceLoader.PostLoadEvent.addPreLoadListener(Consumer<InstanceLoader.PreLoadEvent<E>> listener) Adds a listener toInstanceLoader.PreLoadEvent.Returns the container which accepts the loaded entity.Returns id of the entity to load.Returns the fetch plan used for loading the entity.Returns a function which will be used to load data instead of standard implementation.voidsetContainer(InstanceContainer<E> container) Sets the container which accepts the loaded entity.voidsetEntityId(Object entityId) Sets the id of the entity to load.voidsetFetchPlan(FetchPlan fetchPlan) Sets the fetch plan to use for loading the entity.voidsetFetchPlan(String fetchPlanName) Sets the name of the fetch plan to use for loading the entity.voidsetLoadDelegate(Function<LoadContext<E>, E> delegate) Sets a function which will be used to load data instead of standard implementation.Methods inherited from interface io.jmix.flowui.model.DataLoadergetCondition, getDataContext, getHints, getMonitoringInfoProvider, getParameter, getParameters, getQuery, load, removeParameter, setCondition, setDataContext, setHint, setMonitoringInfoProvider, setParameter, setParameters, setQuery
- 
Method Details- 
getContainerInstanceContainer<E> getContainer()Returns the container which accepts the loaded entity.- Specified by:
- getContainerin interface- DataLoader
 
- 
setContainerSets the container which accepts the loaded entity.
- 
getEntityIdReturns id of the entity to load.
- 
setEntityIdSets the id of the entity to load.
- 
getFetchPlanFetchPlan getFetchPlan()Returns the fetch plan used for loading the entity.
- 
setFetchPlanSets the fetch plan to use for loading the entity.
- 
setFetchPlanSets the name of the fetch plan to use for loading the entity.- Throws:
- IllegalStateException- if the fetch plan has already been set by- setFetchPlan(FetchPlan)
 
- 
getLoadDelegateFunction<LoadContext<E>,E> getLoadDelegate()Returns a function which will be used to load data instead of standard implementation.
- 
setLoadDelegateSets a function which will be used to load data instead of standard implementation.
- 
addPreLoadListenerAdds a listener toInstanceLoader.PreLoadEvent.You can also add an event listener declaratively using a controller method annotated with Subscribe:@Subscribe(id = "fooDl", target = Target.DATA_LOADER) private void onFooDlPreLoad(InstanceLoader.PreLoadEvent<Foo> event) { // handle event here }- Parameters:
- listener- listener
- Returns:
- subscription
 
- 
addPostLoadListenerAdds a listener toInstanceLoader.PostLoadEvent.You can also add an event listener declaratively using a controller method annotated with Subscribe:@Subscribe(id = "fooDl", target = Target.DATA_LOADER) private void onFooDlPostLoad(InstanceLoader.PostLoadEvent<Foo> event) { // handle event here }- Parameters:
- listener- listener
- Returns:
- subscription
 
 
-