org.netbeans.api.mdr/1 1.4.22

org.netbeans.api.mdr.events
Class AttributeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.netbeans.api.mdr.events.MDRChangeEvent
          extended by org.netbeans.api.mdr.events.AttributeEvent
All Implemented Interfaces:
Serializable

public class AttributeEvent
extends MDRChangeEvent

Class represeting MDR events related to changes of repository object (class/instance) attributes.

See Also:
Serialized Form

Field Summary
static int EVENT_ATTRIBUTE_ADD
          Event type indicating that a value element of a multi-valued instance attribute is to be/was added
static int EVENT_ATTRIBUTE_REMOVE
          Event type indicating that a value element of a multi-valued instance attribute is to be/was removed
static int EVENT_ATTRIBUTE_SET
          Event type indicating that a value of a single-valued instance attribute is to be/was changed or a value element of a multi-valued instance attribute is to be/was changed.
static int EVENT_CLASSATTR_ADD
          Event type indicating that a value element of a multi-valued classifier attribute is to be/was added
static int EVENT_CLASSATTR_REMOVE
          Event type indicating that a value element of a multi-valued classifier attribute is to be/was removed
static int EVENT_CLASSATTR_SET
          Event type indicating that a value of a single-valued classifier attribute is to be/was changed or a value element of a multi-valued classifier attribute is to be/was changed.
static int EVENTMASK_ATTRIBUTE
          Bitmask representing all event types related to instance attribute changes
static int EVENTMASK_CLASSATTR
          Bitmask representing all event types related to classifier attribute changes
static int POSITION_NONE
          Value indicating unspecified position
 
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
AttributeEvent(javax.jmi.reflect.RefFeatured source, int type, String attrName, Object oldElement, Object newElement, int position)
          Creates new AttributeEvent instance.
 
Method Summary
 String getAttributeName()
          Returns name of an attribute affected by this event.
 Object getNewElement()
          Returns a new value of the element affected by this event or null if not applicable.
 Object getOldElement()
          Returns original value of the element affected by this event or null if not applicable.
 int getPosition()
          Returns original position of element affected by this event or POSITION_NONE if not applicable.
 
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

POSITION_NONE

public static final int POSITION_NONE
Value indicating unspecified position

See Also:
Constant Field Values

EVENTMASK_ATTRIBUTE

public static final int EVENTMASK_ATTRIBUTE
Bitmask representing all event types related to instance attribute changes

See Also:
Constant Field Values

EVENTMASK_CLASSATTR

public static final int EVENTMASK_CLASSATTR
Bitmask representing all event types related to classifier attribute changes

See Also:
Constant Field Values

EVENT_ATTRIBUTE_SET

public static final int EVENT_ATTRIBUTE_SET
Event type indicating that a value of a single-valued instance attribute is to be/was changed or a value element of a multi-valued instance attribute is to be/was changed.

See Also:
Constant Field Values

EVENT_ATTRIBUTE_ADD

public static final int EVENT_ATTRIBUTE_ADD
Event type indicating that a value element of a multi-valued instance attribute is to be/was added

See Also:
Constant Field Values

EVENT_ATTRIBUTE_REMOVE

public static final int EVENT_ATTRIBUTE_REMOVE
Event type indicating that a value element of a multi-valued instance attribute is to be/was removed

See Also:
Constant Field Values

EVENT_CLASSATTR_SET

public static final int EVENT_CLASSATTR_SET
Event type indicating that a value of a single-valued classifier attribute is to be/was changed or a value element of a multi-valued classifier attribute is to be/was changed.

See Also:
Constant Field Values

EVENT_CLASSATTR_ADD

public static final int EVENT_CLASSATTR_ADD
Event type indicating that a value element of a multi-valued classifier attribute is to be/was added

See Also:
Constant Field Values

EVENT_CLASSATTR_REMOVE

public static final int EVENT_CLASSATTR_REMOVE
Event type indicating that a value element of a multi-valued classifier attribute is to be/was removed

See Also:
Constant Field Values
Constructor Detail

AttributeEvent

public AttributeEvent(javax.jmi.reflect.RefFeatured source,
                      int type,
                      String attrName,
                      Object oldElement,
                      Object newElement,
                      int position)
Creates new AttributeEvent instance.

Parameters:
source - Event source (class proxy or instance).
type - Event type.
attrName - Name of the attribute that was changed.
oldElement - Original attribute value (for single-valued) or value element (for multi-valued attribute) or null if not applicable (e.g. in case of ADD event).
newElement - New attribute value (for single-valued) or value element (for multi-valued attribute) or null if not applicable (e.g. in case of REMOVE event).
position - Position of the affected element or POSITION_NONE if not applicable (e.g. in case of unordered multi-valued attributes).
Method Detail

getAttributeName

public String getAttributeName()
Returns name of an attribute affected by this event.

Returns:
Attribute name.

getOldElement

public Object getOldElement()
Returns original value of the element affected by this event or null if not applicable.

Returns:
Original value of element.

getNewElement

public Object getNewElement()
Returns a new value of the element affected by this event or null if not applicable.

Returns:
New element value.

getPosition

public int getPosition()
Returns original position of element affected by this event or POSITION_NONE if not applicable.

Returns:
Original position of affected element.

org.netbeans.api.mdr/1 1.4.22

Built on July 11 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.