Class ConfigurationBuilderEvent
java.lang.Object
java.util.EventObject
org.apache.commons.configuration2.event.Event
org.apache.commons.configuration2.builder.ConfigurationBuilderEvent
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ConfigurationBuilderResultCreatedEvent
A base event class for events generated by a ConfigurationBuilder
.
Configuration builders can trigger a number of different events. All these events are derived from this class. This
event base class does not define any additional properties. However, it defines that the event source must be a
ConfigurationBuilder
.
- Since:
- 2.0
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final EventType<ConfigurationBuilderEvent>
The common super type for all events related to configuration builders.static final EventType<ConfigurationBuilderEvent>
The specific event type for configuration request events.static final EventType<ConfigurationBuilderEvent>
The specific event type for builder reset events.Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionConfigurationBuilderEvent
(ConfigurationBuilder<?> source, EventType<? extends ConfigurationBuilderEvent> evType) Creates a new instance ofConfigurationBuilderEvent
and sets basic properties. -
Method Summary
Modifier and TypeMethodDescriptionGets the source of this event as aConfigurationBuilder
.Methods inherited from class org.apache.commons.configuration2.event.Event
appendPropertyRepresentation, getEventType, toString
-
Field Details
-
ANY
The common super type for all events related to configuration builders. -
RESET
The specific event type for builder reset events. Events of this type are generated each time the builder'sresetResult()
method is called. -
CONFIGURATION_REQUEST
The specific event type for configuration request events. Events of this type are generated each time the builder'sgetConfiguration()
method is called (before the managed configuration is actually accessed and the lock is acquired). This gives listeners the opportunity to perform some checks which may invalidate the configuration, e.g. trigger a reload check. Note: A listener must not call the builder'sgetConfiguration()
method - this will cause an infinite loop!- See Also:
-
-
Constructor Details
-
ConfigurationBuilderEvent
public ConfigurationBuilderEvent(ConfigurationBuilder<?> source, EventType<? extends ConfigurationBuilderEvent> evType) Creates a new instance ofConfigurationBuilderEvent
and sets basic properties.- Parameters:
source
- theConfigurationBuilder
object which triggered this event (must not be null)evType
- the type of this event (must not be null)- Throws:
IllegalArgumentException
- if a required parameter is null
-
-
Method Details
-
getSource
Gets the source of this event as aConfigurationBuilder
.- Overrides:
getSource
in classEventObject
- Returns:
- the
ConfigurationBuilder
which generated this event
-