org.jconfig.event
Interface PropertyChangedEvent

All Known Subinterfaces:
CategoryChangedEvent, ConfigurationChangedEvent
All Known Implementing Classes:
ConfigurationChangedEventImpl

public interface PropertyChangedEvent

Anytime a Property has changed, this event will be sent. If a Property is deleted, the getNewValue will return null. If a Property is added, the getOldValue will return null. What's trying to be said, is that the returned values should be checked for NullPointerExceptions.

 public void propertyChanged( PropertyChangedEvent event ) { 
 	if( event.getEventType() == PROPERTY_ADDED ) {
		System.out.println("Property was added");
  	System.out.println("Name: " + event.getPropertyName());
 	}
 }
 

Since:
2.2
Author:
Andreas Mecky , Terry Dye

Field Summary
static int CATEGORY_ADDED
          constant representing an added category event
static int CATEGORY_CHANGED
          constant representing a changed category event
static int CATEGORY_REMOVED
          constant representing a removed category event
static int PROPERTY_ADDED
          constant representing an added property event
static int PROPERTY_CHANGED
          constant representing a changed property event
static int PROPERTY_REMOVED
          constant representing a removed property event
 
Method Summary
 int getEventType()
          Information about the event.
 java.lang.String getNewValue()
          The new value of the Property.
 java.lang.String getOldValue()
          The old value of the Property.
 java.lang.String getPropertyName()
          The name of the Property that has changed.
 

Field Detail

PROPERTY_ADDED

public static final int PROPERTY_ADDED
constant representing an added property event

See Also:
Constant Field Values

PROPERTY_REMOVED

public static final int PROPERTY_REMOVED
constant representing a removed property event

See Also:
Constant Field Values

PROPERTY_CHANGED

public static final int PROPERTY_CHANGED
constant representing a changed property event

See Also:
Constant Field Values

CATEGORY_ADDED

public static final int CATEGORY_ADDED
constant representing an added category event

See Also:
Constant Field Values

CATEGORY_REMOVED

public static final int CATEGORY_REMOVED
constant representing a removed category event

See Also:
Constant Field Values

CATEGORY_CHANGED

public static final int CATEGORY_CHANGED
constant representing a changed category event

See Also:
Constant Field Values
Method Detail

getPropertyName

public java.lang.String getPropertyName()
The name of the Property that has changed.

Returns:
The Property's name

getOldValue

public java.lang.String getOldValue()
The old value of the Property. Can be <null>, if a Property was added.

Returns:
The old value

getNewValue

public java.lang.String getNewValue()
The new value of the Property. Can be <null>, if a Property was deleted.

Returns:
The new value

getEventType

public int getEventType()
Information about the event.

Returns:
The event's identifier/type
See Also:
PROPERTY_ADDED, PROPERTY_REMOVED, CATEGORY_ADDED, CATEGORY_REMOVED


Copyright © 2001-2005 Andreas Mecky, Terry Dye. All Rights Reserved.