public abstract class ActionListener<T extends CoreAction<?>>
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
ActionListener(java.lang.Class<T> targetClass)
Creates ActionListener with targetClass
|
Modifier and Type | Method and Description |
---|---|
<R> void |
addAfterEvent(java.util.function.Consumer<R> f,
java.lang.Class returnType)
Add after event
|
void |
addAfterEvent(java.lang.String classOrActionName)
Add after event
|
<R> void |
addBeforeEvent(java.util.function.Consumer<R> f,
java.lang.Class returnType) |
<R> void |
addBeforeEvent(java.util.function.Consumer<R> f,
java.lang.Class returnType,
boolean raiseExceptionOnFalse) |
void |
addBeforeEvent(java.lang.String classOrActionName) |
void |
addBeforeEvent(java.lang.String classOrActionName,
boolean raiseExceptionOnFalse)
Add before event
|
void |
addReplaceEvent(java.lang.String classOrActionName)
Add replace event
|
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. |
ActionListener<T> |
clone() |
java.util.List<EventActionInfo> |
getAfter() |
java.util.List<EventActionInfo> |
getBefore() |
java.lang.String |
getReplace() |
java.lang.Class<T> |
getTargetClass() |
void |
setTargetClass(java.lang.Class<T> targetClass) |
public ActionListener(java.lang.Class<T> targetClass)
targetClass
- the type of action this listener listens topublic final java.lang.Class<T> getTargetClass()
public final void setTargetClass(java.lang.Class<T> targetClass)
targetClass
- the targetClass to setpublic final void addBeforeEvent(java.lang.String classOrActionName)
public final <R> void addBeforeEvent(java.util.function.Consumer<R> f, java.lang.Class returnType, boolean raiseExceptionOnFalse)
public final <R> void addBeforeEvent(java.util.function.Consumer<R> f, java.lang.Class returnType)
public final void addBeforeEvent(java.lang.String classOrActionName, boolean raiseExceptionOnFalse)
a
- public final void addAfterEvent(java.lang.String classOrActionName)
a
- public final <R> void addAfterEvent(java.util.function.Consumer<R> f, java.lang.Class returnType)
f
- A function to take action on context and T.public final void addReplaceEvent(java.lang.String classOrActionName)
public final java.util.List<EventActionInfo> getAfter()
public final java.util.List<EventActionInfo> getBefore()
public final java.lang.String getReplace()
public abstract boolean check(T action)
action
- public ActionListener<T> clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException