Package org.ametys.runtime.i18n
Class I18nizableDateTime
- java.lang.Object
-
- org.ametys.runtime.i18n.I18nizableDateTime
-
- All Implemented Interfaces:
FormatableI18nizable
,I18nizable
,I18nizableTextParameter
public class I18nizableDateTime extends Object implements FormatableI18nizable, I18nizableTextParameter
Allow to useZonedDateTime
as a parameter forI18nizableText
.
-
-
Constructor Summary
Constructors Constructor Description I18nizableDateTime(ZonedDateTime dateTime, ZoneId zoneId, String pattern)
Build anI18nizableDateTime
fromZonedDateTime
and pattern.I18nizableDateTime(ZonedDateTime dateTime, ZoneId zoneId, FormatStyle style)
Build anI18nizableDateTime
fromZonedDateTime
and style.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
format(Locale locale)
Outputs a localized String representation.void
toSAX(ContentHandler handler)
Represents thisI18nizable
as SAX events.void
toSAXAsParam(ContentHandler handler)
Represents thisI18nizableTextParameter
as SAX events for anI18nizableText
parameter.-
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
-
-
-
-
Constructor Detail
-
I18nizableDateTime
public I18nizableDateTime(ZonedDateTime dateTime, ZoneId zoneId, FormatStyle style)
Build anI18nizableDateTime
fromZonedDateTime
and style.- Parameters:
dateTime
- the valuezoneId
- the time zone to use for formattingstyle
- the style to use for formatting
-
I18nizableDateTime
public I18nizableDateTime(ZonedDateTime dateTime, ZoneId zoneId, String pattern)
Build anI18nizableDateTime
fromZonedDateTime
and pattern.- Parameters:
dateTime
- the valuezoneId
- the time zone to use for formattingpattern
- the pattern to use for formatting
-
-
Method Detail
-
toSAX
public void toSAX(ContentHandler handler) throws SAXException
Description copied from interface:I18nizable
Represents thisI18nizable
as SAX events.- Specified by:
toSAX
in 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:I18nizableTextParameter
Represents thisI18nizableTextParameter
as SAX events for anI18nizableText
parameter.- Specified by:
toSAXAsParam
in interfaceI18nizableTextParameter
- Parameters:
handler
- the SAX content handler- Throws:
SAXException
- if an error occurs
-
format
public String format(Locale locale)
Description copied from interface:FormatableI18nizable
Outputs a localized String representation.- Specified by:
format
in interfaceFormatableI18nizable
- Parameters:
locale
- theLocale
to use.- Returns:
- a localized String.
-
-