public abstract class AbstractCancelableEvent extends AbstractFilterableEvent implements CancelableEvent
Modifier | Constructor and Description |
---|---|
protected |
AbstractCancelableEvent()
Constructor initializing the event filter with an
AlwaysMatchingEventFilter , meaning that this event will match any
other event of the same type. |
protected |
AbstractCancelableEvent(EventFilter eventFilter)
Constructor using a custom
EventFilter . |
protected |
AbstractCancelableEvent(String name)
Constructor initializing the event filter with a
FixedNameEventFilter ,
meaning that this event will match only events of the same type affecting the same passed name. |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel the event.
|
void |
cancel(String reason)
Cancel the event, giving a reason why.
|
String |
getReason()
Get the reason why the event was canceled.
|
boolean |
isCanceled()
Check if this event was canceled by one of the receivers.
|
equals, getEventFilter, hashCode, matches
protected AbstractCancelableEvent()
AlwaysMatchingEventFilter
, meaning that this event will match any
other event of the same type.protected AbstractCancelableEvent(String name)
FixedNameEventFilter
,
meaning that this event will match only events of the same type affecting the same passed name.name
- a generic name that uniquely identifies an event typeprotected AbstractCancelableEvent(EventFilter eventFilter)
EventFilter
.eventFilter
- the filter to use for matching eventspublic boolean isCanceled()
CancelableEvent
isCanceled
in interface CancelableEvent
public void cancel()
CancelableEvent
cancel
in interface CancelableEvent
public void cancel(String reason)
CancelableEvent
cancel
in interface CancelableEvent
reason
- the reason why the event was canceledpublic String getReason()
CancelableEvent
getReason
in interface CancelableEvent
CancelableEvent.cancel()
Copyright © 2004–2021 XWiki. All rights reserved.