public class ConfigurationEvent extends Event
An event class for reporting updates on a configuration object.
Event objects of this type are used for "raw" events, i.e. unfiltered modifications of any kind. A level with semantically higher events (e.g. for property changes) may be built on top of this fundamental event mechanism.
Each event can contain the following data:
The following standard events are generated by typical configuration implementations (the constants for the event types are defined in this class:
addProperty()
method of a configuration object. It contains the name of the property, to
which new data is added, and the value object that is added to this property
(this may be an array or a list if multiple values are added).setProperty()
method triggers this event. The
event object stores the name of the affected property and its new value.clearProperty()
method), an event of this type is fired. In
this case the event object only stores the name of the removed property, the
value is null.Modifier and Type | Field and Description |
---|---|
static EventType<ConfigurationEvent> |
ADD_NODES
Constant for the event type for an add nodes operation.
|
static EventType<ConfigurationEvent> |
ADD_PROPERTY
Constant for the event type for an add property operation.
|
static EventType<ConfigurationEvent> |
ANY
Constant for the common super type of all configuration update events.
|
static EventType<ConfigurationEvent> |
ANY_HIERARCHICAL
Constant for the common base event type for all hierarchical update
events.
|
static EventType<ConfigurationEvent> |
CLEAR
Constant for the event type for a clear operation.
|
static EventType<ConfigurationEvent> |
CLEAR_PROPERTY
Constant for the event type for a clear property operation.
|
static EventType<ConfigurationEvent> |
CLEAR_TREE
Constant for the event type for a clear tree operation.
|
static EventType<ConfigurationEvent> |
SET_PROPERTY
Constant for the event type for a set property operation.
|
static EventType<ConfigurationEvent> |
SUBNODE_CHANGED
Constant for the event type indicating a change on a sub configuration.
|
source
Constructor and Description |
---|
ConfigurationEvent(Object source,
EventType<? extends ConfigurationEvent> type,
String propertyName,
Object propertyValue,
boolean beforeUpdate)
Creates a new instance of
ConfigurationEvent and
initializes it. |
Modifier and Type | Method and Description |
---|---|
String |
getPropertyName()
Returns the name of the affected property.
|
Object |
getPropertyValue()
Returns the value of the affected property if available.
|
boolean |
isBeforeUpdate()
Returns a flag if this event was generated before or after an update.
|
appendPropertyRepresentation, getEventType, toString
getSource
public static final EventType<ConfigurationEvent> ANY
public static final EventType<ConfigurationEvent> ADD_PROPERTY
public static final EventType<ConfigurationEvent> SET_PROPERTY
public static final EventType<ConfigurationEvent> CLEAR_PROPERTY
public static final EventType<ConfigurationEvent> CLEAR
public static final EventType<ConfigurationEvent> ANY_HIERARCHICAL
public static final EventType<ConfigurationEvent> ADD_NODES
public static final EventType<ConfigurationEvent> CLEAR_TREE
public static final EventType<ConfigurationEvent> SUBNODE_CHANGED
public ConfigurationEvent(Object source, EventType<? extends ConfigurationEvent> type, String propertyName, Object propertyValue, boolean beforeUpdate)
ConfigurationEvent
and
initializes it.source
- the event sourcetype
- the event's typepropertyName
- the name of the affected propertypropertyValue
- the value of the affected propertybeforeUpdate
- the before update flagpublic String getPropertyName()
public Object getPropertyValue()
public boolean isBeforeUpdate()
Copyright © 2001–2020 The Apache Software Foundation. All rights reserved.