Package org.apache.fop.events
Class EventFormatter
- java.lang.Object
-
- org.apache.fop.events.EventFormatter
-
public final class EventFormatter extends java.lang.Object
Converts events into human-readable, localized messages.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
EventFormatter.LookupFieldPart
static class
EventFormatter.LookupFieldPartFactory
PartFactory for lookups.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.Pattern
INCLUDES_PATTERN
private static org.apache.commons.logging.Log
log
-
Constructor Summary
Constructors Modifier Constructor Description private
EventFormatter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
format(Event event)
Formats an event using the default locale.static java.lang.String
format(Event event, java.lang.String pattern)
Formats the event using a given pattern.static java.lang.String
format(Event event, java.util.Locale locale)
Formats an event using a given locale.private static java.lang.String
format(Event event, java.util.ResourceBundle bundle)
private static java.util.ResourceBundle
getBundle(java.lang.String groupID, java.util.Locale locale)
private static java.lang.String
processIncludes(java.lang.String template, java.util.ResourceBundle bundle)
private static int
processIncludesInner(java.lang.CharSequence template, java.lang.StringBuffer sb, java.util.ResourceBundle bundle)
-
-
-
Method Detail
-
getBundle
private static java.util.ResourceBundle getBundle(java.lang.String groupID, java.util.Locale locale)
-
format
public static java.lang.String format(Event event)
Formats an event using the default locale.- Parameters:
event
- the event- Returns:
- the formatted message
-
format
public static java.lang.String format(Event event, java.util.Locale locale)
Formats an event using a given locale.- Parameters:
event
- the eventlocale
- the locale- Returns:
- the formatted message
-
format
private static java.lang.String format(Event event, java.util.ResourceBundle bundle)
-
processIncludes
private static java.lang.String processIncludes(java.lang.String template, java.util.ResourceBundle bundle)
-
processIncludesInner
private static int processIncludesInner(java.lang.CharSequence template, java.lang.StringBuffer sb, java.util.ResourceBundle bundle)
-
format
public static java.lang.String format(Event event, java.lang.String pattern)
Formats the event using a given pattern. The pattern needs to be compatible withAdvancedMessageFormat
.- Parameters:
event
- the eventpattern
- the pattern (compatible withAdvancedMessageFormat
)- Returns:
- the formatted message
-
-