public class ClassEvent
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private character |
event
The event's name.
|
private java.lang.String |
evtName
The event's legacy name.
|
private handle |
publisher
The event's publisher (object instance where it was defined or the pseudo-object for the
legacy class, if is static.
|
private InternalEntry |
signature
Representation of the event's signature.
|
Constructor and Description |
---|
ClassEvent(_BaseObject_ publisher,
java.lang.String evtName,
java.lang.String fieldName)
Create a new class event from the given publisher.
|
ClassEvent(java.lang.Class<? extends _BaseObject_> publisher,
java.lang.String evtName,
java.lang.String fieldName)
Create a new class event from the given publisher (which is a static class).
|
Modifier and Type | Method and Description |
---|---|
private InternalEntry |
buildSignature(java.lang.Class<?> def,
java.lang.String field)
Build an
InternalEntry using the LegacySignature annotation appearing at the
Java field declaring this class event. |
void |
publish(java.lang.Object... args)
Notify all subscribers by publishing this event using the given arguments.
|
void |
subscribe(handle subscriber,
character method)
Unsubscribe the specified method, in the given object, from this event.
|
void |
subscribe(object<? extends _BaseObject_> ref,
character method)
Subscribe the specified method, in the given object, for notifications from this event.
|
void |
unsubscribe(handle subscriber,
character method)
Unsubscribe the specified internal procedure, in the given program, from this event.
|
void |
unsubscribe(object<? extends _BaseObject_> ref,
character method)
Unsubscribe the specified method, in the given object, from this event.
|
private boolean |
valid(handle subscriber,
character method)
Validate the specified subscriber and method name.
|
private final InternalEntry signature
private final character event
private final handle publisher
private final java.lang.String evtName
public ClassEvent(java.lang.Class<? extends _BaseObject_> publisher, java.lang.String evtName, java.lang.String fieldName)
publisher
- The legacy type.evtName
- The legacy class event name.fieldName
- The converted name for the Java field.public ClassEvent(_BaseObject_ publisher, java.lang.String evtName, java.lang.String fieldName)
publisher
- The legacy object instance.evtName
- The legacy class event name.fieldName
- The converted name for the Java field.public void publish(java.lang.Object... args)
args
- The published arguments.public void subscribe(handle subscriber, character method)
The method must be defined in the given object.
subscriber
- The subscriber reference.method
- The method name.public void subscribe(object<? extends _BaseObject_> ref, character method)
The method must be defined in the given object.
ref
- The object reference.method
- The method name.public void unsubscribe(handle subscriber, character method)
The internal procedure must be defined in the given program.
subscriber
- The program handle.method
- The method name.public void unsubscribe(object<? extends _BaseObject_> ref, character method)
The method must be defined in the given object.
ref
- The object reference.method
- The method name.private boolean valid(handle subscriber, character method)
subscriber
- The subscriber handle - must be a valid external program.method
- The method name - must be a defined internal procedure.private InternalEntry buildSignature(java.lang.Class<?> def, java.lang.String field)
InternalEntry
using the LegacySignature
annotation appearing at the
Java field declaring this class event.def
- The OO class.field
- The converted field name.InternalEntry
representing the event's signature.