Package org.apache.fop.events
Class Event
java.lang.Object
java.util.EventObject
org.apache.fop.events.Event
- All Implemented Interfaces:
Serializable
This is the default event class used by this package. Each event has a unique event identifier
(a String), a severity indicator, a locale (for formatting event messages), and a map of
name/value pairs.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
This class is a fluent builder class for building up the parameter map. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private String
private Locale
private static final long
private EventSeverity
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the event group identifier.Returns the event identifier.Returns the event key.Returns the locale.Returns a parameter.Returns an unmodifiableMap
with all event parameters.Returns the severity level.static Event.ParamsBuilder
Creates and returns a fluent builder object for building up the parameter map.void
setSeverity
(EventSeverity severity) Sets the event's severity level.Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
eventGroupID
-
eventKey
-
severity
-
locale
-
params
-
-
Constructor Details
-
Event
Creates a new Event using default locale.- Parameters:
source
- the object that creates the eventeventID
- the unique identifier of the eventseverity
- the severity levelparams
- the event parameters (a map of name/value pairs)
-
Event
public Event(Object source, String eventID, EventSeverity severity, Locale locale, Map<String, Object> params) Creates a new Event.- Parameters:
source
- the object that creates the eventeventID
- the unique identifier of the eventseverity
- the severity levellocale
- to use when formatting event (or null, which means use default locale)params
- the event parameters (a map of name/value pairs)
-
-
Method Details
-
getEventID
Returns the event identifier.- Returns:
- the event identifier
-
getEventGroupID
Returns the event group identifier.- Returns:
- the event group identifier (or null if there is no group identifier)
-
getEventKey
Returns the event key.- Returns:
- the event key
-
getSeverity
Returns the severity level.- Returns:
- the severity level
-
setSeverity
Sets the event's severity level. This method can be used to increase or decrease the severity level in a listener.- Parameters:
severity
- the new event severity
-
getLocale
Returns the locale.- Returns:
- the locale
-
getParam
Returns a parameter.- Parameters:
key
- the key to the parameter- Returns:
- the parameter value or null if no value with this key is found
-
getParams
Returns an unmodifiableMap
with all event parameters.- Returns:
- the parameter map
-
paramsBuilder
Creates and returns a fluent builder object for building up the parameter map.- Returns:
- the parameter builder
-