Class Event

java.lang.Object
java.util.EventObject
org.apache.fop.events.Event
All Implemented Interfaces:
Serializable

public class Event extends EventObject
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:
  • Field Details

  • Constructor Details

    • Event

      public Event(Object source, String eventID, EventSeverity severity, Map<String,Object> params)
      Creates a new Event using default locale.
      Parameters:
      source - the object that creates the event
      eventID - the unique identifier of the event
      severity - the severity level
      params - 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 event
      eventID - the unique identifier of the event
      severity - the severity level
      locale - 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

      public String getEventID()
      Returns the event identifier.
      Returns:
      the event identifier
    • getEventGroupID

      public String getEventGroupID()
      Returns the event group identifier.
      Returns:
      the event group identifier (or null if there is no group identifier)
    • getEventKey

      public String getEventKey()
      Returns the event key.
      Returns:
      the event key
    • getSeverity

      public EventSeverity getSeverity()
      Returns the severity level.
      Returns:
      the severity level
    • setSeverity

      public void setSeverity(EventSeverity severity)
      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

      public Locale getLocale()
      Returns the locale.
      Returns:
      the locale
    • getParam

      public Object getParam(String key)
      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

      public Map<String,Object> getParams()
      Returns an unmodifiable Map with all event parameters.
      Returns:
      the parameter map
    • paramsBuilder

      public static Event.ParamsBuilder paramsBuilder()
      Creates and returns a fluent builder object for building up the parameter map.
      Returns:
      the parameter builder