public static class CollectionLoader.PreLoadEvent<T extends Entity>
extends java.util.EventObject
You can prevent load using the preventLoad()
method of the event, for example:
@Subscribe(id = "fooDl", target = Target.DATA_LOADER) private void onFooDlPreLoad(CollectionLoader.PreLoadEvent event) { if (doNotLoad()) { event.preventLoad(); } }
Constructor and Description |
---|
PreLoadEvent(CollectionLoader<T> loader,
LoadContext<T> loadContext) |
Modifier and Type | Method and Description |
---|---|
LoadContext<T> |
getLoadContext()
Returns the load context of the current data loader.
|
CollectionLoader<T> |
getSource()
The data loader which sent the event.
|
boolean |
isLoadPrevented()
Returns true if
preventLoad() method was called and loading will be aborted. |
void |
preventLoad()
Invoke this method if you want to abort the loading.
|
public PreLoadEvent(CollectionLoader<T> loader, LoadContext<T> loadContext)
public CollectionLoader<T> getSource()
getSource
in class java.util.EventObject
public LoadContext<T> getLoadContext()
public void preventLoad()
public boolean isLoadPrevented()
preventLoad()
method was called and loading will be aborted.