Class Trigger
- java.lang.Object
-
- net.fortuna.ical4j.model.Content
-
- net.fortuna.ical4j.model.Property
-
- net.fortuna.ical4j.model.property.DateProperty<Instant>
-
- net.fortuna.ical4j.model.property.Trigger
-
- All Implemented Interfaces:
Serializable
,Comparable<Property>
,FluentProperty
,UtcProperty
public class Trigger extends DateProperty<Instant> implements UtcProperty
$Id$ Created: [Apr 6, 2004] Defines a TRIGGER iCalendar component property.4.8.6.3 Trigger Property Name: TRIGGER Purpose: This property specifies when an alarm will trigger. Value Type: The default value type is DURATION. The value type can be set to a DATE-TIME value type, in which case the value MUST specify a UTC formatted DATE-TIME value. Property Parameters: Non-standard, value data type, time zone identifier or trigger relationship property parameters can be specified on this property. The trigger relationship property parameter MUST only be specified when the value type is DURATION. Conformance: This property MUST be specified in the "VALARM" calendar component. Description: Within the "VALARM" calendar component, this property defines when the alarm will trigger. The default value type is DURATION, specifying a relative time for the trigger of the alarm. The default duration is relative to the start of an event or to-do that the alarm is associated with. The duration can be explicitly set to trigger from either the end or the start of the associated event or to-do with the "RELATED" parameter. A value of START will set the alarm to trigger off the start of the associated event or to-do. A value of END will set the alarm to trigger off the end of the associated event or to-do. Either a positive or negative duration may be specified for the "TRIGGER" property. An alarm with a positive duration is triggered after the associated start or end of the event or to-do. An alarm with a negative duration is triggered before the associated start or end of the event or to-do. The "RELATED" property parameter is not valid if the value type of the property is set to DATE-TIME (i.e., for an absolute date and time alarm trigger). If a value type of DATE-TIME is specified, then the property value MUST be specified in the UTC time format. If an absolute trigger is specified on an alarm for a recurring event or to-do, then the alarm will only trigger for the specified absolute date/time, along with any specified repeating instances. If the trigger is set relative to START, then the "DTSTART" property MUST be present in the associated "VEVENT" or "VTODO" calendar component. If an alarm is specified for an event with the trigger set relative to the END, then the "DTEND" property or the "DSTART" and "DURATION' properties MUST be present in the associated "VEVENT" calendar component. If the alarm is specified for a to-do with a trigger set relative to the END, then either the "DUE" property or the "DSTART" and "DURATION' properties MUST be present in the associated "VTODO" calendar component. Alarms specified in an event or to-do which is defined in terms of a DATE value type will be triggered relative to 00:00:00 UTC on the specified date. For example, if "DTSTART:19980205, then the duration trigger will be relative to19980205T000000Z. Format Definition: The property is defined by the following notation: trigger = "TRIGGER" (trigrel / trigabs) trigrel = *( ; the following are optional, ; but MUST NOT occur more than once (";" "VALUE" "=" "DURATION") / (";" trigrelparam) / ; the following is optional, ; and MAY occur more than once (";" xparam) ) ":" dur-value trigabs = 1*( ; the following is REQUIRED, ; but MUST NOT occur more than once (";" "VALUE" "=" "DATE-TIME") / ; the following is optional, ; and MAY occur more than once (";" xparam) ) ":" date-time
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Trigger.Factory
-
Field Summary
-
Fields inherited from class net.fortuna.ical4j.model.Property
ACKNOWLEDGED, ACTION, ATTACH, ATTENDEE, BUSYTYPE, CALENDAR_ADDRESS, CALSCALE, CATEGORIES, CLASS, COMMENT, COMPLETED, CONTACT, COUNTRY, CREATED, DESCRIPTION, DTEND, DTSTAMP, DTSTART, DUE, DURATION, EXDATE, EXPERIMENTAL_PREFIX, EXRULE, EXTENDED_ADDRESS, FREEBUSY, GEO, LAST_MODIFIED, LOCALITY, LOCATION, LOCATION_TYPE, METHOD, NAME, ORGANIZER, PARTICIPANT_TYPE, PERCENT_COMPLETE, POSTALCODE, PRIORITY, PRODID, PROXIMITY, RDATE, RECURRENCE_ID, REGION, RELATED_TO, REPEAT, REQUEST_STATUS, RESOURCE_TYPE, RESOURCES, RRULE, SEQUENCE, STATUS, STREET_ADDRESS, STRUCTURED_DATA, STYLED_DESCRIPTION, SUMMARY, TEL, TRANSP, TRIGGER, TZID, TZID_ALIAS_OF, TZNAME, TZOFFSETFROM, TZOFFSETTO, TZUNTIL, TZURL, UID, URL, VERSION
-
-
Constructor Summary
Constructors Constructor Description Trigger()
Default constructor.Trigger(Instant dateTime)
Trigger(TemporalAmount duration)
Trigger(Dur duration)
Deprecated.Trigger(ParameterList aList, String aValue)
Trigger(ParameterList aList, Instant dateTime)
Trigger(ParameterList aList, TemporalAmount duration)
Trigger(ParameterList aList, Dur duration)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TemporalAmount
getDuration()
String
getValue()
boolean
isAbsolute()
Indicates whether the trigger is relative or absolute.protected PropertyFactory<Trigger>
newFactory()
Returns a new property factory used to create deep copies.void
setDate(Instant dateTime)
Sets the date value of this property.void
setDefaultTimeZone(ZoneId defaultTimeZone)
A default timezone may be specified for interpreting floating DATE-TIME values.void
setDuration(TemporalAmount duration)
void
setTimeZoneRegistry(TimeZoneRegistry timeZoneRegistry)
void
setValue(String aValue)
Default setValue() implementation.ValidationResult
validate()
Perform validation on a property.-
Methods inherited from class net.fortuna.ical4j.model.property.DateProperty
compareTo, getDate, hashCode, isUtc
-
Methods inherited from class net.fortuna.ical4j.model.Property
add, copy, equals, getFluentTarget, getName, getParameter, getParameterList, getParameters, getPrefix, getRequiredParameter, remove, removeAll, replace, setParameters, setPrefix, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.fortuna.ical4j.model.FluentProperty
withParameter
-
-
-
-
Constructor Detail
-
Trigger
public Trigger()
Default constructor.
-
Trigger
public Trigger(ParameterList aList, String aValue)
- Parameters:
aList
- a list of parameters for this componentaValue
- a value string for this component
-
Trigger
@Deprecated public Trigger(Dur duration)
Deprecated.- Parameters:
duration
- a duration in milliseconds
-
Trigger
public Trigger(TemporalAmount duration)
- Parameters:
duration
- a duration in milliseconds
-
Trigger
@Deprecated public Trigger(ParameterList aList, Dur duration)
Deprecated.- Parameters:
aList
- a list of parameters for this componentduration
- a duration in milliseconds
-
Trigger
public Trigger(ParameterList aList, TemporalAmount duration)
- Parameters:
aList
- a list of parameters for this componentduration
- a duration in milliseconds
-
Trigger
public Trigger(Instant dateTime)
- Parameters:
dateTime
- a date representation of a date-time
-
Trigger
public Trigger(ParameterList aList, Instant dateTime)
- Parameters:
aList
- a list of parameters for this componentdateTime
- a date representation of a date-time
-
-
Method Detail
-
isAbsolute
public boolean isAbsolute()
Indicates whether the trigger is relative or absolute.- Returns:
- true if the trigger is absolute
-
validate
public ValidationResult validate() throws ValidationException
Perform validation on a property.- Overrides:
validate
in classDateProperty<Instant>
- Throws:
ValidationException
- where the property is not in a valid state
-
getDuration
public final TemporalAmount getDuration()
- Returns:
- Returns the duration.
-
setValue
public final void setValue(String aValue)
Default setValue() implementation. Allows for either DATE or DATE-TIME values. Note that this method will use the system default zone rules to parse the string value. For parsing string values in a different timezone useTemporalAdapter.parse(String, ZoneId)
andDateProperty.setDate(Temporal)
.- Overrides:
setValue
in classDateProperty<Instant>
- Parameters:
aValue
- a string representation of a DATE or DATE-TIME value
-
getValue
public final String getValue()
- Overrides:
getValue
in classDateProperty<Instant>
- Returns:
- the content value
-
setDate
public void setDate(Instant dateTime)
Description copied from class:DateProperty
Sets the date value of this property. The timezone and value of this instance will also be updated accordingly.- Overrides:
setDate
in classDateProperty<Instant>
- Parameters:
dateTime
- The dateTime to set.
-
setDuration
public final void setDuration(TemporalAmount duration)
- Parameters:
duration
- The duration to set.
-
setTimeZoneRegistry
public void setTimeZoneRegistry(TimeZoneRegistry timeZoneRegistry)
- Specified by:
setTimeZoneRegistry
in interfaceUtcProperty
- Overrides:
setTimeZoneRegistry
in classDateProperty<Instant>
-
setDefaultTimeZone
public void setDefaultTimeZone(ZoneId defaultTimeZone)
Description copied from class:DateProperty
A default timezone may be specified for interpreting floating DATE-TIME values. In the absence of a default timezone the system default timezone will be used.- Specified by:
setDefaultTimeZone
in interfaceUtcProperty
- Overrides:
setDefaultTimeZone
in classDateProperty<Instant>
- Parameters:
defaultTimeZone
- a timezone identifier
-
newFactory
protected PropertyFactory<Trigger> newFactory()
Description copied from class:Property
Returns a new property factory used to create deep copies.- Specified by:
newFactory
in classProperty
- Returns:
- a property factory instance
-
-