Interface EntityCallbacks
public interface EntityCallbacks
Interface to be implemented by objects that can manage a number of
EntityCallback objects and invoke these
with a specific entity.- Since:
- 2.2
- Author:
- Christoph Strobl
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntityCallback(EntityCallback<?> callback) Add the givencallbackusing generic type argument detection for identification of supported types.<T> Tcallback(Class<? extends EntityCallback> callbackType, T entity, Object... args) Invoke matchingentity callbackswith given arguments.static EntityCallbackscreate()Obtain a newEntityCallbacksinstance.static EntityCallbackscreate(BeanFactory beanFactory) Obtain a newEntityCallbacksinstance.static EntityCallbackscreate(EntityCallback<?>... callbacks) Create a newEntityCallbacksinstance with givencallbacks.
-
Method Details
-
addEntityCallback
Add the givencallbackusing generic type argument detection for identification of supported types.- Parameters:
callback- must not be null.- Throws:
IllegalArgumentException- if the required argument is null.
-
callback
Invoke matchingentity callbackswith given arguments.- Type Parameters:
T- Entity type.- Parameters:
callbackType- must not be null.entity- must not be null.args- optional arguments.- Returns:
- never null.
- Throws:
IllegalArgumentException- if a required argument is null.
-
create
Create a newEntityCallbacksinstance with givencallbacks.
The providedcallbacksare immediatelyadded. -
create
Obtain a newEntityCallbacksinstance.
UseaddEntityCallback(EntityCallback)to register callbacks manually. -
create
Obtain a newEntityCallbacksinstance.callbacksare pre loaded from the givenBeanFactory.
UseaddEntityCallback(EntityCallback)to register additional callbacks manually.- Parameters:
beanFactory- must not be null.- Throws:
IllegalArgumentException- if a required argument is null.
-