Interface HasDataComponents

All Known Subinterfaces:
FragmentData, ViewData
All Known Implementing Classes:
AbstractDataComponentsHolder, FragmentDataImpl, ViewDataImpl

public interface HasDataComponents
Interface defining methods for interacting with data API elements.
  • Method Details

    • getDataContext

      DataContext getDataContext()
      Returns view's DataContext.
      Throws:
      IllegalStateException - if the DataContext is not defined
    • getDataContextOrNull

      @Nullable DataContext getDataContextOrNull()
      Returns view's DataContext or null if it is not defined.
    • setDataContext

      void setDataContext(DataContext dataContext)
      Sets DataContext instance for the view.
    • getContainer

      <T extends InstanceContainer<?>> T getContainer(String id)
      Returns a container by its id.
      Throws:
      IllegalArgumentException - if there is no such container
    • getLoader

      <T extends DataLoader> T getLoader(String id)
      Returns a loader by its id.
      Throws:
      IllegalArgumentException - if there is no such loader
    • getContainerIds

      Set<String> getContainerIds()
      Returns ids of all registered containers.
    • getLoaderIds

      Set<String> getLoaderIds()
      Returns ids of all registered loaders.
    • registerContainer

      void registerContainer(String id, InstanceContainer<?> container)
      Registers the given container
    • registerLoader

      void registerLoader(String id, DataLoader loader)
      Registers the given loader
    • loadAll

      void loadAll()
      Performs DataLoader.load() for all loaders registered in the view.