Class ActionListener<T extends CoreAction<?>>

java.lang.Object
com.mendix.core.actionmanagement.ActionListener<T>
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
UserActionListener

public abstract class ActionListener<T extends CoreAction<?>> extends Object implements Cloneable
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.
  • Constructor Details

    • ActionListener

      public ActionListener(Class<T> targetClass)
      Creates ActionListener with targetClass.
      Parameters:
      targetClass - the type of action this listener listens to
  • Method Details

    • getTargetClass

      public final Class<T> getTargetClass()
      Returns the type of action this listener listens to.
      Returns:
      the target class
    • setTargetClass

      public final void setTargetClass(Class<T> targetClass)
      Sets the type of action this listener listens to to the specified target class.
      Parameters:
      targetClass - the target class to set
    • addBeforeEvent

      public final void addBeforeEvent(String classOrActionName)
    • 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 public final <R> void addBeforeEvent(Consumer<R> consumer, Class<?> returnType)
      Deprecated.
    • addBeforeEvent

      public final void addBeforeEvent(String classOrActionName, boolean raiseExceptionOnFalse)
    • addAfterEvent

      public final void addAfterEvent(String classOrActionName)
    • addAfterEvent

      public final <R> void addAfterEvent(Consumer<IMendixObject> consumer)
    • addAfterEvent

      @Deprecated public final <R> void addAfterEvent(Consumer<R> consumer, Class<?> returnType)
      Deprecated.
      Add after event.
      Parameters:
      consumer - A function to take action on context and T.
    • addReplaceEvent

      public final void addReplaceEvent(String classOrActionName)
    • getAfter

      public final List<EventActionInfo> getAfter()
    • getBefore

      public final List<EventActionInfo> getBefore()
    • getReplace

      public final String getReplace()
    • check

      public abstract boolean check(T action)
      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 class Object
      Throws:
      CloneNotSupportedException