- Direct Known Subclasses:
ICalBuilder.Alarm
,ICalBuilder.Common
,ICalBuilder.Component
- Enclosing class:
- ICalBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LinkedList<String>
Lines of text created for the iCalendar format, but without the EOL sequence and/or line folding. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttachment
(String formatType, byte[] data) Add an attachment provided as binary data.void
addAttachment
(String formatType, String uri) Add an attachment referenced by a URI.void
addProperty
(String property, boolean escapeValues, String... values) Add a property with no parameters to this iCalendar component.void
addProperty
(String property, String[] params, boolean escapeValues, String... values) Add a property with multiple parameters to this iCalendar component.void
addProperty
(String property, String param, boolean escapeValues, String... values) Add a property with a single parameter to this iCalendar component.protected void
Clear the content lines.protected void
Generate content lines.void
setDuration
(int duration, ICalBuilder.Units units) Set the duration for an iCalendar component.
-
Field Details
-
contentLines
Lines of text created for the iCalendar format, but without the EOL sequence and/or line folding. Subclasses will use this field to record the lines they create.
-
-
Constructor Details
-
Base
protected Base()Constructor.
-
-
Method Details
-
setDuration
Set the duration for an iCalendar component. Durations are define in Section 3.8.2.5 of RFC 5545 Some iCalendar components do not have a 'duration' property, and the subclasses for those components will throw an exception if this method is called (this behavior should be documented by all subclasses that do not support this method).- Parameters:
duration
- the duration, either a positive integer or 0 if the duration should be ignoredunits
- the units for the duration (ICalBuilder.Units.SECONDS
,ICalBuilder.Units.MINUTES
,ICalBuilder.Units.HOURS
,ICalBuilder.Units.DAYS
, orICalBuilder.Units.WEEKS
); null only if the duration is 0- Throws:
UnsupportedOperationException
- if an iCalendar component does not have a duration.IllegalArgumentException
- an argument had an illegal value
-
addAttachment
Add an attachment referenced by a URI. Attachments are defined in Section 3.8.1.1 of RFC 5545. The media type is defined in Section 4.2 of RFC 4288. Some iCalendar components do not have an 'attachment' property, and the subclasses for those components will throw an exception if this method is called (this behavior should be documented by all subclasses that do not support this method).- Parameters:
formatType
- the media type of an attachmenturi
- the URI referencing the attachment- Throws:
UnsupportedOperationException
- a subclass does not allow attachments
-
addAttachment
Add an attachment provided as binary data. The media type is defined in Section 4.2 of RFC 4288. Attachments are defined in Section 3.8.1.1 of RFC 5545. Some iCalendar components do not have an 'attachment' property, and the subclasses for those components will throw an exception if this method is called (this behavior should be documented by all subclasses that do not support this method).- Parameters:
formatType
- the media type of an attachmentdata
- an array of bytes containing the attachment- Throws:
UnsupportedOperationException
- a subclass does not allow attachments
-
addProperty
Add a property with no parameters to this iCalendar component. RFC 5544 provides a sizable number of properties, and allows experimental ones to be added. This method allows a property to be explicitly added.If the values are URIs, the third argument (escapeValues) should be set to false; for text, it should be set to true. The property name must be one allowed by RFC 5545 for the current iCalendar component. None of the arguments should be folded.
As a general rule, the caller of this method should set the 'escapeValues' argument so that the user can provide values that have not been escaped: typically only text values need to be escaped.
- Parameters:
property
- the name of the propertyescapeValues
- true if the the values should be escaped by this method; false otherwisevalues
- one or more values for the property
-
addProperty
Add a property with a single parameter to this iCalendar component. RFC 5544 provides a sizable number of properties, and allows experimental ones to be added. This method allows any property to be explicitly added.If the values are URIs, the third argument (escapeValues) should be set to false; for text, it should be set to true. The property name must be one allowed by RFC 5545 for the current iCalendar component. A parameter should not be escaped, and none of the arguments should be folded.
As a general rule, the caller of this method should set the 'escapeValues' argument so that the user can provide values that have not been escaped: typically only text values need to be escaped.
- Parameters:
property
- the name of the propertyparam
- the property's parameter; an empty string if there are no parametersescapeValues
- true if the the values should be escaped by this method; false otherwisevalues
- one or more values for the property
-
addProperty
Add a property with multiple parameters to this iCalendar component. RFC 5544 provides a sizable number of properties, and allows experimental ones to be added. This method allows any property to be explicitly added.If the values are URIs, the third argument (escapeValues) should be set to false; for text, it should be set to true. The property name must be one allowed by RFC 5545 for the current iCalendar component. A parameter should not be escaped, and none of the arguments should be folded.
As a general rule, the caller of this method should set the 'escapeValues' argument so that the user can provide values that have not been escaped: typically only text values need to be escaped.
- Parameters:
property
- the name of the propertyparams
- the property's parameters; a zero-length array indicates that there are no parameters.escapeValues
- true if the the values should be escaped by this method; false otherwisevalues
- one or more values for the property
-
createContentLines
protected void createContentLines()Generate content lines. Subclasses that override this method should callsuper.createContentLines()
. -
clearContentLines
protected void clearContentLines()Clear the content lines. Subclasses that override this method must call super.clearContentLines().
-