Package org.ametys.runtime.i18n
Class I18nizableDate
- java.lang.Object
-
- org.ametys.runtime.i18n.I18nizableDate
-
- All Implemented Interfaces:
FormatableI18nizable,I18nizable,I18nizableTextParameter
public class I18nizableDate extends Object implements FormatableI18nizable, I18nizableTextParameter
Allow to useLocalDateas a parameter forI18nizableText.
-
-
Field Summary
Fields Modifier and Type Field Description private LocalDate_dateprivate DateTimeFormatter_formatterprivate String_pattern
-
Constructor Summary
Constructors Constructor Description I18nizableDate(LocalDate date, String pattern)Build anI18nizableDatefromLocalDateand pattern.I18nizableDate(LocalDate date, FormatStyle style)Build anI18nizableDatefromLocalDateand style.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringformat(Locale locale)Outputs a localized String representation.voidtoSAX(ContentHandler handler)Represents thisI18nizableas SAX events.voidtoSAXAsParam(ContentHandler handler)Represents thisI18nizableTextParameteras SAX events for anI18nizableTextparameter.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.runtime.i18n.I18nizable
toSAX
-
-
-
-
Field Detail
-
_formatter
private DateTimeFormatter _formatter
-
-
Constructor Detail
-
I18nizableDate
public I18nizableDate(LocalDate date, FormatStyle style)
Build anI18nizableDatefromLocalDateand style.- Parameters:
date- the valuestyle- the style to use for formatting
-
I18nizableDate
public I18nizableDate(LocalDate date, String pattern)
Build anI18nizableDatefromLocalDateand pattern.- Parameters:
date- the valuepattern- the pattern to use for formatting
-
-
Method Detail
-
toSAX
public void toSAX(ContentHandler handler) throws SAXException
Description copied from interface:I18nizableRepresents thisI18nizableas SAX events.- Specified by:
toSAXin interfaceI18nizable- Parameters:
handler- the SAX content handler- Throws:
SAXException- if an error occurs
-
toSAXAsParam
public void toSAXAsParam(ContentHandler handler) throws SAXException
Description copied from interface:I18nizableTextParameterRepresents thisI18nizableTextParameteras SAX events for anI18nizableTextparameter.- Specified by:
toSAXAsParamin interfaceI18nizableTextParameter- Parameters:
handler- the SAX content handler- Throws:
SAXException- if an error occurs
-
format
public String format(Locale locale)
Description copied from interface:FormatableI18nizableOutputs a localized String representation.- Specified by:
formatin interfaceFormatableI18nizable- Parameters:
locale- theLocaleto use.- Returns:
- a localized String.
-
-