|
org.netbeans.api.mdr/1 1.4.22 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.EventObject org.netbeans.api.mdr.events.MDRChangeEvent org.netbeans.api.mdr.events.InstanceEvent
public class InstanceEvent
MDR Event used for representing events related to lifecycle of class instances (creation and deletion of instances). As this event contains attribute pointing to the affected (created/deleted) instance, it will need to be subclassed in repository implementation. This is because each implementation has to send the same event object to both pre-change and change events. In case of the instance create event, the actual instance is not known by the time the pre-change event is fired (so the event object is created providing null for this attribute), however the created instance has to be referenced from the event object passed to the change event. As the implementation is not allow to send a different instance of event object to the change event, it needs to be able to set the instance property of the original event object. For this purpose a subclass of this event object containing a package protected setter for the instance attribute should be used. Note that for this purpose the instance property is defined as protected instead of private final.
Field Summary | |
---|---|
static int |
EVENT_INSTANCE_CREATE
Identifier for event type that indicates creation of a new instance of a class. |
static int |
EVENT_INSTANCE_DELETE
Identifier for event type that indicates an instance of a class is to be/was deleted. |
static int |
EVENTMASK_INSTANCE
Bitmask representing all the events related to instance lifecycle. |
protected javax.jmi.reflect.RefObject |
instance
|
Fields inherited from class org.netbeans.api.mdr.events.MDRChangeEvent |
---|
EVENTMASK_ALL, EVENTMASK_ON_ASSOCIATION, EVENTMASK_ON_CLASS, EVENTMASK_ON_INSTANCE, EVENTMASK_ON_PACKAGE, EVENTMASK_ON_REPOSITORY |
Fields inherited from class java.util.EventObject |
---|
source |
Constructor Summary | |
---|---|
InstanceEvent(javax.jmi.reflect.RefFeatured source,
int type,
List arguments,
javax.jmi.reflect.RefObject instance)
Creates new InstanceEvent object. |
Method Summary | |
---|---|
List |
getArguments()
Returns list of initial values for instance attributes (only applicable for instance creation - otherwise null). |
javax.jmi.reflect.RefObject |
getInstance()
Returns the created/deleted instance. |
Methods inherited from class org.netbeans.api.mdr.events.MDRChangeEvent |
---|
getType, isOfType |
Methods inherited from class java.util.EventObject |
---|
getSource, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int EVENTMASK_INSTANCE
public static final int EVENT_INSTANCE_CREATE
public static final int EVENT_INSTANCE_DELETE
protected javax.jmi.reflect.RefObject instance
Constructor Detail |
---|
public InstanceEvent(javax.jmi.reflect.RefFeatured source, int type, List arguments, javax.jmi.reflect.RefObject instance)
source
- Event source (class proxy in case of instance creation, instance in case of instance deletion).type
- Event type.arguments
- Immutable list of initial attribute values of the new instance (null in case of instance deletion).instance
- The created/deleted instance or null (in case of pre-change event indicating instance creation).Method Detail |
---|
public List getArguments()
public javax.jmi.reflect.RefObject getInstance()
|
org.netbeans.api.mdr/1 1.4.22 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |