Package com.mendix.core.actionmanagement
Class ActionListener<T extends CoreAction<?>>
java.lang.Object
com.mendix.core.actionmanagement.ActionListener<T>
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
UserActionListener
Abstract ActionListener
T is the type of CoreAction this listener listens to. If the check method returns true, the actions defined in before, concurrent and after will be executed.
T is the type of CoreAction this listener listens to. If the check method returns true, the actions defined in before, concurrent and after will be executed.
-
Constructor Summary
ConstructorDescriptionActionListener
(Class<T> targetClass) Creates ActionListener with targetClass. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addAfterEvent
(String classOrActionName) final <R> void
addAfterEvent
(Consumer<IMendixObject> consumer) final <R> void
addAfterEvent
(Consumer<R> consumer, Class<?> returnType) Deprecated.final void
addBeforeEvent
(String classOrActionName) final void
addBeforeEvent
(String classOrActionName, boolean raiseExceptionOnFalse) final <R> void
addBeforeEvent
(Consumer<IMendixObject> consumer, boolean raiseExceptionOnFalse) final <R> void
addBeforeEvent
(Consumer<R> consumer, Class<?> returnType) Deprecated.final <R> void
addBeforeEvent
(Consumer<R> consumer, Class<?> returnType, boolean raiseExceptionOnFalse) Deprecated.final void
addReplaceEvent
(String classOrActionName) abstract boolean
Checks if this Listener's events must be fired
If an action of type T is executed in the Core this function is called with that action as parameter.
If this method returns true, the before/concurrent/after actions of this ActionListener will be executed too.clone()
final List<EventActionInfo>
getAfter()
final List<EventActionInfo>
final String
Returns the type of action this listener listens to.final void
setTargetClass
(Class<T> targetClass) Sets the type of action this listener listens to to the specified target class.
-
Constructor Details
-
ActionListener
Creates ActionListener with targetClass.- Parameters:
targetClass
- the type of action this listener listens to
-
-
Method Details
-
getTargetClass
Returns the type of action this listener listens to.- Returns:
- the target class
-
setTargetClass
Sets the type of action this listener listens to to the specified target class.- Parameters:
targetClass
- the target class to set
-
addBeforeEvent
-
addBeforeEvent
public final <R> void addBeforeEvent(Consumer<IMendixObject> consumer, boolean raiseExceptionOnFalse) -
addBeforeEvent
@Deprecated public final <R> void addBeforeEvent(Consumer<R> consumer, Class<?> returnType, boolean raiseExceptionOnFalse) Deprecated. -
addBeforeEvent
Deprecated. -
addBeforeEvent
-
addAfterEvent
-
addAfterEvent
-
addAfterEvent
Deprecated.Add after event.- Parameters:
consumer
- A function to take action on context and T.
-
addReplaceEvent
-
getAfter
-
getBefore
-
getReplace
-
check
Checks if this Listener's events must be fired
If an action of type T is executed in the Core this function is called with that action as parameter.
If this method returns true, the before/concurrent/after actions of this ActionListener will be executed too.- Returns:
- true if this Listener's events must be fired if action is executed
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-