com.atlassian.confluence.core
Class DefaultFormatSettingsManager

java.lang.Object
  extended by com.atlassian.confluence.core.DefaultFormatSettingsManager
All Implemented Interfaces:
FormatSettingsManager

public class DefaultFormatSettingsManager
extends Object
implements FormatSettingsManager

Implementation of FormatSettingsManager which persists the date format settings in Bandana.

Returns constant default values if the configuration has not been set.

See Also:
BandanaManager

Field Summary
static String BLOG_DATE_PATTERN
           
static String DEFAULT_DATE_PATTERN
           
static String DEFAULT_DATE_TIME_PATTERN
           
static String DEFAULT_DECIMAL_NUMBER_PATTERN
           
static String DEFAULT_LONG_NUMBER_PATTERN
           
static String DEFAULT_TIME_PATTERN
           
static String EDITOR_BLOG_DATE_PATTERN
           
 
Constructor Summary
DefaultFormatSettingsManager()
           
 
Method Summary
 String getDateFormat()
          Returns the formatting pattern used for dates.
 String getDateTimeFormat()
          Returns the formatting pattern used for date and time together.
 String getDayFormat()
          Deprecated. since 3.5 this simply redirects to getDateFormat. Previously defaulted to "MMM dd"
 String getDecimalNumberFormat()
          Returns the formatting pattern used for decimal numbers.
 String getEditorBlogPostDate()
          Returns the date time format for the editor blog post date
 String getLongNumberFormat()
          Returns the formatting pattern used for integer numbers.
 String getTimeFormat()
          Returns the formatting pattern used for times.
 void setBandanaManager(com.atlassian.bandana.BandanaManager bandanaManager)
           
 void setDateFormat(String pattern)
          Stores the formatting pattern to be used for dates.
 void setDateTimeFormat(String pattern)
          Stores the formatting pattern to be used for date and time together.
 void setDayFormat(String pattern)
          Deprecated. since 3.5 dayFormat is no longer supported
 void setDecimalNumberFormat(String pattern)
          Stores the formatting pattern to be used for decimal numbers.
 void setLongNumberFormat(String pattern)
          Stores the formatting pattern to be used for integer numbers.
 void setTimeFormat(String pattern)
          Stores the formatting pattern to be used for times.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DATE_PATTERN

public static final String DEFAULT_DATE_PATTERN
See Also:
Constant Field Values

DEFAULT_DATE_TIME_PATTERN

public static final String DEFAULT_DATE_TIME_PATTERN
See Also:
Constant Field Values

BLOG_DATE_PATTERN

public static final String BLOG_DATE_PATTERN
See Also:
Constant Field Values

EDITOR_BLOG_DATE_PATTERN

public static final String EDITOR_BLOG_DATE_PATTERN
See Also:
Constant Field Values

DEFAULT_TIME_PATTERN

public static final String DEFAULT_TIME_PATTERN
See Also:
Constant Field Values

DEFAULT_LONG_NUMBER_PATTERN

public static final String DEFAULT_LONG_NUMBER_PATTERN
See Also:
Constant Field Values

DEFAULT_DECIMAL_NUMBER_PATTERN

public static final String DEFAULT_DECIMAL_NUMBER_PATTERN
See Also:
Constant Field Values
Constructor Detail

DefaultFormatSettingsManager

public DefaultFormatSettingsManager()
Method Detail

getDateFormat

public String getDateFormat()
Description copied from interface: FormatSettingsManager
Returns the formatting pattern used for dates. Typically something like "d MMM, yyyy".

Specified by:
getDateFormat in interface FormatSettingsManager

setDateFormat

public void setDateFormat(String pattern)
Description copied from interface: FormatSettingsManager
Stores the formatting pattern to be used for dates.

Specified by:
setDateFormat in interface FormatSettingsManager
Parameters:
pattern - a pattern compatible with SimpleDateFormat

getTimeFormat

public String getTimeFormat()
Description copied from interface: FormatSettingsManager
Returns the formatting pattern used for times. Typically something like "h:mm a".

Specified by:
getTimeFormat in interface FormatSettingsManager

setTimeFormat

public void setTimeFormat(String pattern)
Description copied from interface: FormatSettingsManager
Stores the formatting pattern to be used for times.

Specified by:
setTimeFormat in interface FormatSettingsManager
Parameters:
pattern - a pattern compatible with SimpleDateFormat

getDayFormat

public String getDayFormat()
Deprecated. since 3.5 this simply redirects to getDateFormat. Previously defaulted to "MMM dd"

Description copied from interface: FormatSettingsManager
Was previously a slightly shorter format for representing a day, usually without a year. Is now identical to FormatSettingsManager.getDateFormat().

Specified by:
getDayFormat in interface FormatSettingsManager
Returns:
the String representation of the date format

setDayFormat

public void setDayFormat(String pattern)
Deprecated. since 3.5 dayFormat is no longer supported

Description copied from interface: FormatSettingsManager
Does nothing. Previously set the "dayFormat", which has been dropped in favour of always using FormatSettingsManager.getDateFormat().

Specified by:
setDayFormat in interface FormatSettingsManager
See Also:
FormatSettingsManager.getDayFormat()

getDateTimeFormat

public String getDateTimeFormat()
Description copied from interface: FormatSettingsManager
Returns the formatting pattern used for date and time together. Typically something like "d MMM, yyyy HH:mm".

Specified by:
getDateTimeFormat in interface FormatSettingsManager

setDateTimeFormat

public void setDateTimeFormat(String pattern)
Description copied from interface: FormatSettingsManager
Stores the formatting pattern to be used for date and time together.

Specified by:
setDateTimeFormat in interface FormatSettingsManager
Parameters:
pattern - a pattern compatible with SimpleDateFormat

getEditorBlogPostDate

public String getEditorBlogPostDate()
Description copied from interface: FormatSettingsManager
Returns the date time format for the editor blog post date

Specified by:
getEditorBlogPostDate in interface FormatSettingsManager

getLongNumberFormat

public String getLongNumberFormat()
Description copied from interface: FormatSettingsManager
Returns the formatting pattern used for integer numbers. Typically something like "###############".

Specified by:
getLongNumberFormat in interface FormatSettingsManager

setLongNumberFormat

public void setLongNumberFormat(String pattern)
Description copied from interface: FormatSettingsManager
Stores the formatting pattern to be used for integer numbers.

Specified by:
setLongNumberFormat in interface FormatSettingsManager
Parameters:
pattern - a pattern compatible with DecimalFormat

getDecimalNumberFormat

public String getDecimalNumberFormat()
Description copied from interface: FormatSettingsManager
Returns the formatting pattern used for decimal numbers. Typically something like "###############.##########".

Specified by:
getDecimalNumberFormat in interface FormatSettingsManager

setDecimalNumberFormat

public void setDecimalNumberFormat(String pattern)
Description copied from interface: FormatSettingsManager
Stores the formatting pattern to be used for decimal numbers.

Specified by:
setDecimalNumberFormat in interface FormatSettingsManager
Parameters:
pattern - a pattern compatible with DecimalFormat

setBandanaManager

public void setBandanaManager(com.atlassian.bandana.BandanaManager bandanaManager)


Copyright © 2003-2011 Atlassian. All Rights Reserved.