uk.org.simonsite.log4j.appender
Class LocalizedDateFormatPatternHelper

java.lang.Object
  extended by uk.org.simonsite.log4j.appender.LocalizedDateFormatPatternHelper

final class LocalizedDateFormatPatternHelper
extends Object

Provides support for processing SimpleDateFormat patterns.

NB Due to a dependence upon DateFormatSymbols.getLocalPatternChars() any DateFormat objects must also be initialised with SimpleDateFormat.applyLocalizedPattern(String).

Version:
2.1
Author:
Simon Park
See Also:
DateFormatSymbols, DateFormat, SimpleDateFormat

Constructor Summary
LocalizedDateFormatPatternHelper(Locale datePatternLocale)
           
 
Method Summary
(package private)  String amPmPatternRegex()
           
(package private)  String dayPatternRegex()
           
(package private)  String excludeQuoted(String datePattern)
          Strips out quoted sections from a date format pattern to leave us with only characters meant to be interpreted by (or which are reserved by) SimpleDateFormat.
(package private)  String hourPatternRegex()
           
(package private)  String minutePatternRegex()
           
(package private)  String monthPatternRegex()
           
(package private)  String weekPatternRegex()
           
(package private)  String yearPatternRegex()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalizedDateFormatPatternHelper

LocalizedDateFormatPatternHelper(Locale datePatternLocale)
Method Detail

minutePatternRegex

final String minutePatternRegex()
Returns:
A regular expression used to match only characters representing the 'Minute in hour' part of a date-time pattern.

hourPatternRegex

final String hourPatternRegex()
Returns:
A regular expression used to match only characters representing the 'Hour in day (0-23)', 'Hour in day (1-24)', 'Hour in am/pm (0-11)', or 'Hour in am/pm (1-12)' part of a date-time pattern.

amPmPatternRegex

final String amPmPatternRegex()
Returns:
A regular expression used to match only characters representing the 'Am/pm marker' part of a date-time pattern.

dayPatternRegex

final String dayPatternRegex()
Returns:
A regular expression used to match only characters representing the 'Day in year', 'Day in month', 'Day of week in month', or 'Day in week' part of a date-time pattern.

weekPatternRegex

final String weekPatternRegex()
Returns:
A regular expression used to match only characters representing the 'Week in year' or 'Week in month' part of a date-time pattern.

monthPatternRegex

final String monthPatternRegex()
Returns:
A regular expression used to match only characters representing the 'Month in year' part of a date-time pattern.

yearPatternRegex

final String yearPatternRegex()
Returns:
A regular expression used to match only characters representing the 'year' part of a date-time pattern.

excludeQuoted

final String excludeQuoted(String datePattern)
Strips out quoted sections from a date format pattern to leave us with only characters meant to be interpreted by (or which are reserved by) SimpleDateFormat.

Parameters:
datePattern - The full pattern specified by the appender config.
Returns:
The datePattern minus quoted sections.
See Also:
SimpleDateFormat