public class CallbackInfo extends java.lang.Object implements Cancellable
| Constructor and Description |
|---|
CallbackInfo(java.lang.String name,
boolean cancellable)
This ctor is always called by injected code
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
If the object is cancellable, cancels the object, implementors may throw
an EventCancellationException if the object is not actually cancellable.
|
static java.lang.String |
getCallInfoClassName(org.spongepowered.asm.lib.Type returnType)
Gets the
CallbackInfo class name to use for the specified return
type. |
java.lang.String |
getId()
Get the ID of the injector which defined this callback.
|
boolean |
isCancellable()
Get whether this is actually cancellable
|
boolean |
isCancelled()
Get whether this is cancelled
|
java.lang.String |
toString() |
public CallbackInfo(java.lang.String name,
boolean cancellable)
name - calling method namecancellable - true if the callback can be cancelledpublic java.lang.String getId()
Inject.id()
parameter on the injectorpublic java.lang.String toString()
toString in class java.lang.Objectpublic final boolean isCancellable()
CancellableisCancellable in interface Cancellablepublic final boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic void cancel()
throws CancellationException
Cancellablecancel in interface CancellableCancellationException - (optional) may be thrown if the object is
not actually cancellable. Contractually, this object may not throw
the exception if isCancellable() returns true.public static java.lang.String getCallInfoClassName(org.spongepowered.asm.lib.Type returnType)
CallbackInfo class name to use for the specified return
type. Currently returns CallbackInfo for void types and
CallbackInfoReturnable for non-void types.returnType - return type of the target method