public final class ResourceBundleEvent
extends java.util.EventObject
ResourceBundleEvent
is fired when the contents of a
ResourceBundleWrapper changes. A ResourceBundleEvent object is sent as an
argument to the ResourceBundleListner methods.
A null
value may be used in for either or both text and metadata when the
values are not known, and always for REMOVED
messages. key
can
only be null if the event type is UNKNOWN.Modifier and Type | Class and Description |
---|---|
static class |
ResourceBundleEvent.EventType
Type (ADDED, REMOVED, or MODIFIED) represented by this EventObject.
|
Modifier and Type | Field and Description |
---|---|
protected ResourceBundleEvent.EventType |
eventType |
protected java.lang.String |
key |
protected java.util.Map<java.lang.String,java.lang.String> |
metadata |
protected java.lang.String |
text |
Constructor and Description |
---|
ResourceBundleEvent(ResourceBundleWrapper source)
Constructor for creating an
UNKNOWN event |
ResourceBundleEvent(ResourceBundleWrapper source,
java.lang.String key,
java.lang.String text,
java.util.Map<java.lang.String,java.lang.String> metadata,
ResourceBundleEvent.EventType eventType)
Constructs a new ResourceBundleEvent with the specified source, key,
text, and metadata of the specified type.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getKey()
The key identified by this event.
|
java.util.Map<java.lang.String,java.lang.String> |
getMetadata()
The metdata identified by this event, or
null |
ResourceBundleWrapper |
getSource()
The
ResourceBundleWrapper on which the Event initially occurred. |
java.lang.String |
getText()
The new translatable text identified by this event, or
null |
protected java.lang.String key
protected java.lang.String text
protected java.util.Map<java.lang.String,java.lang.String> metadata
protected ResourceBundleEvent.EventType eventType
public ResourceBundleEvent(ResourceBundleWrapper source, java.lang.String key, java.lang.String text, java.util.Map<java.lang.String,java.lang.String> metadata, ResourceBundleEvent.EventType eventType)
This method throws an IllegalArgumentException
if source
or is null or key
is null
and the event type is not UNKNOWN
.
text
and metadata
may both be null
.
source
- The source ResourceBundleWrapper
for this event.key
- The key represented by this event.text
- The translable text identified by the key.metadata
- Any metadata associated with the key.eventType
- Type of event.ResourceBundleWrapper
,
ResourceBundleEvent.EventType
public ResourceBundleEvent(ResourceBundleWrapper source)
UNKNOWN
eventsource
- The source ResourceBundleWrapper
for this event.public ResourceBundleWrapper getSource()
ResourceBundleWrapper
on which the Event initially occurred.getSource
in class java.util.EventObject
public java.lang.String getKey()
public java.lang.String getText()
null
null
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
null
null