Class ICal4JDateCodec
- java.lang.Object
-
- org.silverpeas.core.calendar.ical4j.ICal4JDateCodec
-
-
Constructor Summary
Constructors Constructor Description ICal4JDateCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Temporal
decode(net.fortuna.ical4j.model.Date aDate)
Decodes an iCal4J Date or DateTime into a Temporal.net.fortuna.ical4j.model.Date
encode(boolean eventRecurrent, CalendarComponent component, Temporal aTemporal)
Encodes a temporal data into an iCal4J date.net.fortuna.ical4j.model.Date
encode(LocalDate date)
Encodes a date into an iCal4J date.net.fortuna.ical4j.model.DateTime
encode(OffsetDateTime dateTime)
Encodes a datetime into an iCal4J date set in UTC.net.fortuna.ical4j.model.Date
encode(Temporal aTemporal)
Encodes a temporal data into an iCal4J date.net.fortuna.ical4j.model.DateTime
encode(ZonedDateTime dateTime)
Encodes a datetime into an iCal4J date that takes into account the time zone of the specified datetime.net.fortuna.ical4j.model.DateList
encode(Collection<? extends Temporal> temporals)
Encodes a temporal data set into an iCal4J date.net.fortuna.ical4j.model.TimeZone
getTimeZone(ZoneId zoneId)
boolean
isEventDateToBeEncodedIntoUtc(boolean eventRecurrent, CalendarComponent component)
Indicates if the date of an component must be encoded in UTC.TemporalConverter.Conversion<LocalDate,net.fortuna.ical4j.model.Date>
localDateConversion()
Gets the conversion function of aLocalDate
instance to an iCal4J date object.TemporalConverter.Conversion<OffsetDateTime,net.fortuna.ical4j.model.Date>
offsetDateTimeConversion()
Gets the conversion function of anOffsetDateTime
instance to an iCal4J date object.TemporalConverter.Conversion<ZonedDateTime,net.fortuna.ical4j.model.Date>
zonedDateTimeConversion()
Gets the conversion function of aZonedDateTime
instance to an iCal4J date object.
-
-
-
Method Detail
-
isEventDateToBeEncodedIntoUtc
public boolean isEventDateToBeEncodedIntoUtc(boolean eventRecurrent, CalendarComponent component)
Indicates if the date of an component must be encoded in UTC.- Parameters:
eventRecurrent
- true if event is recurrent, false otherwise.component
- the component data from which to verify the conditions.- Returns:
- true if dates must be encoded into UTC, false otherwise.
-
encode
public net.fortuna.ical4j.model.Date encode(boolean eventRecurrent, CalendarComponent component, Temporal aTemporal)
Encodes a temporal data into an iCal4J date.- Parameters:
eventRecurrent
- true if event is recurrent, false otherwise.component
- the component data to use to encode the given temporal.aTemporal
- the temporal data to encode which have to be extracted from the given component.- Returns:
- an iCal4J date.
- Throws:
org.silverpeas.kernel.SilverpeasRuntimeException
- if the encoding fails.
-
encode
public net.fortuna.ical4j.model.Date encode(Temporal aTemporal)
Encodes a temporal data into an iCal4J date.- Parameters:
aTemporal
- the temporal data to encode.- Returns:
- an iCal4J date.
- Throws:
IllegalArgumentException
- if the encoding fails.
-
encode
public net.fortuna.ical4j.model.DateList encode(Collection<? extends Temporal> temporals)
Encodes a temporal data set into an iCal4J date.- Parameters:
temporals
- the temporal data set to encode.- Returns:
- an iCal4J date.
- Throws:
org.silverpeas.kernel.SilverpeasRuntimeException
- if the encoding fails.
-
encode
public net.fortuna.ical4j.model.DateTime encode(OffsetDateTime dateTime)
Encodes a datetime into an iCal4J date set in UTC.- Parameters:
dateTime
- the datetime to encode.- Returns:
- an iCal4J date.
- Throws:
org.silverpeas.kernel.SilverpeasRuntimeException
- if the encoding fails.
-
encode
public net.fortuna.ical4j.model.DateTime encode(ZonedDateTime dateTime)
Encodes a datetime into an iCal4J date that takes into account the time zone of the specified datetime.- Parameters:
dateTime
- the datetime with timezone to encode.- Returns:
- an iCal4J date.
- Throws:
org.silverpeas.kernel.SilverpeasRuntimeException
- if the encoding fails.
-
encode
public net.fortuna.ical4j.model.Date encode(LocalDate date)
Encodes a date into an iCal4J date.- Parameters:
date
- a date.- Returns:
- an iCal4J date.
- Throws:
org.silverpeas.kernel.SilverpeasRuntimeException
- if the encoding fails.
-
offsetDateTimeConversion
public TemporalConverter.Conversion<OffsetDateTime,net.fortuna.ical4j.model.Date> offsetDateTimeConversion()
Gets the conversion function of anOffsetDateTime
instance to an iCal4J date object. The function will throw aSilverpeasRuntimeException
if the conversion fails.- Returns:
- a conversion of a
OffsetDateTime
to an iCal4JDateTime
value.
-
zonedDateTimeConversion
public TemporalConverter.Conversion<ZonedDateTime,net.fortuna.ical4j.model.Date> zonedDateTimeConversion()
Gets the conversion function of aZonedDateTime
instance to an iCal4J date object. The function will throw aSilverpeasRuntimeException
if the conversion fails.- Returns:
- a conversion of a
ZonedDateTime
to an iCal4JDateTime
value.
-
localDateConversion
public TemporalConverter.Conversion<LocalDate,net.fortuna.ical4j.model.Date> localDateConversion()
Gets the conversion function of aLocalDate
instance to an iCal4J date object. The function will throw aSilverpeasRuntimeException
if the conversion fails.- Returns:
- a conversion of a
LocalDate
to an iCal4JDate
value.
-
getTimeZone
public net.fortuna.ical4j.model.TimeZone getTimeZone(ZoneId zoneId)
-
decode
public final Temporal decode(net.fortuna.ical4j.model.Date aDate)
Decodes an iCal4J Date or DateTime into a Temporal.- Parameters:
aDate
- the Date or DateTime to decode.- Returns:
- a temporal instance. If the temporal contains time data, then UTC timezone is set.
- Throws:
org.silverpeas.kernel.SilverpeasRuntimeException
- if the decoding fails.
-
-