biweekly.property
Class ICalProperty

java.lang.Object
  extended by biweekly.property.ICalProperty
Direct Known Subclasses:
Attachment, DateOrDateTimeProperty, FreeBusy, Geo, ListProperty, RawProperty, RecurrenceDates, RecurrenceRule, RequestStatus, Trigger, UtcOffsetProperty, ValuedProperty, Version

public abstract class ICalProperty
extends Object

Base class for all iCalendar properties.

Author:
Michael Angstadt

Field Summary
protected  ICalParameters parameters
          The property parameters.
 
Constructor Summary
ICalProperty()
           
 
Method Summary
 void addParameter(String name, String value)
          Adds a value to a parameter.
protected  String getAltRepresentation()
          Gets a URI pointing to additional information about the entity represented by the property.
protected  String getCommonName()
          Gets the display name of the person.
protected  String getDirectoryEntry()
          Gets a URI that contains additional information about the person.
protected  String getFormatType()
          Gets the content-type of the property's value.
protected  String getLanguage()
          Gets the language that the property value is written in.
 String getParameter(String name)
          Gets the first value of the parameter with the given name.
 ICalParameters getParameters()
          Gets the property's parameters.
 List<String> getParameters(String name)
          Gets all values of the parameter with the given name.
protected  String getSentBy()
          Gets a person that is acting on behalf of the person defined in the property.
protected  String getTimezoneId()
          Gets the timezone identifier.
 void removeParameter(String name)
          Removes a parameter from the property.
protected  void setAltRepresentation(String uri)
          Sets a URI pointing to additional information about the entity represented by the property.
protected  void setCommonName(String commonName)
          Sets the display name of the person.
protected  void setDirectoryEntry(String uri)
          Sets a URI that contains additional information about the person.
protected  void setFormatType(String formatType)
          Sets the content-type of the property's value.
protected  void setLanguage(String language)
          Sets the language that the property value is written in.
 void setParameter(String name, Collection<String> values)
          Sets a parameter's values, replacing all pre-existing values.
 void setParameter(String name, String value)
          Sets a parameter's value, replacing all pre-existing values.
 void setParameters(ICalParameters parameters)
          Sets the property's parameters
protected  void setSentBy(String uri)
          Sets a person that is acting on behalf of the person defined in the property.
protected  void setTimezone(VTimezone timezone)
          Sets the property's timezone to a timezone that is defined within the iCalendar object.
protected  void setTimezoneId(String timezoneId)
          Sets the property's timezone in the form of a globally-defined timezone (e.g.
 List<String> validate(List<ICalComponent> components)
          Checks the property for data consistency problems or deviations from the spec.
protected  void validate(List<ICalComponent> components, List<String> warnings)
          Checks the property for data consistency problems or deviations from the spec.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parameters

protected ICalParameters parameters
The property parameters.

Constructor Detail

ICalProperty

public ICalProperty()
Method Detail

getParameters

public ICalParameters getParameters()
Gets the property's parameters.

Returns:
the parameters

setParameters

public void setParameters(ICalParameters parameters)
Sets the property's parameters

Parameters:
parameters - the parameters

getParameter

public String getParameter(String name)
Gets the first value of the parameter with the given name.

Parameters:
name - the parameter name (case insensitive, e.g. "LANGUAGE")
Returns:
the parameter value or null if not found

getParameters

public List<String> getParameters(String name)
Gets all values of the parameter with the given name.

Parameters:
name - the parameter name (case insensitive, e.g. "LANGUAGE")
Returns:
the parameter values

addParameter

public void addParameter(String name,
                         String value)
Adds a value to a parameter.

Parameters:
name - the parameter name (case insensitive, e.g. "LANGUAGE")
value - the parameter value

setParameter

public void setParameter(String name,
                         String value)
Sets a parameter's value, replacing all pre-existing values.

Parameters:
name - the parameter name (case insensitive, e.g. "LANGUAGE")
value - the parameter value

setParameter

public void setParameter(String name,
                         Collection<String> values)
Sets a parameter's values, replacing all pre-existing values.

Parameters:
name - the parameter name (case insensitive, e.g. "LANGUAGE")
values - the parameter values

removeParameter

public void removeParameter(String name)
Removes a parameter from the property.

Parameters:
name - the parameter name (case insensitive, e.g. "LANGUAGE")

getAltRepresentation

protected String getAltRepresentation()
Gets a URI pointing to additional information about the entity represented by the property.

Returns:
the URI or null if not set
See Also:
RFC 5545 p.14-5

setAltRepresentation

protected void setAltRepresentation(String uri)
Sets a URI pointing to additional information about the entity represented by the property.

Parameters:
uri - the URI or null to remove
See Also:
RFC 5545 p.14-5

getFormatType

protected String getFormatType()
Gets the content-type of the property's value.

Returns:
the content type (e.g. "image/png") or null if not set
See Also:
RFC 5545 p.19-20

setFormatType

protected void setFormatType(String formatType)
Sets the content-type of the property's value.

Parameters:
formatType - the content type (e.g. "image/png") or null to remove
See Also:
RFC 5545 p.19-20

getLanguage

protected String getLanguage()
Gets the language that the property value is written in.

Returns:
the language (e.g. "en" for English) or null if not set
See Also:
RFC 5545 p.21

setLanguage

protected void setLanguage(String language)
Sets the language that the property value is written in.

Parameters:
language - the language (e.g. "en" for English) or null to remove
See Also:
RFC 5545 p.21

getTimezoneId

protected String getTimezoneId()
Gets the timezone identifier. This either (a) references the TimezoneId property of a VTimezone component, or (b) specifies a globally-defined timezone (e.g. "America/New_York"). For a list of globally-defined timezones, see the TZ database.

Returns:
the timezone identifier or null if not set
See Also:
RFC 5545 p.27-8

setTimezoneId

protected void setTimezoneId(String timezoneId)
Sets the property's timezone in the form of a globally-defined timezone (e.g. "America/New_York"). For a list of globally-defined timezones, see the TZ database. Use setTimezone(VTimezone) to use a timezone that's defined within the iCalendar object.

Parameters:
timezoneId - the timezone identifier (e.g. "America/New_York") or null to remove
See Also:
RFC 5545 p.27-8

setTimezone

protected void setTimezone(VTimezone timezone)
Sets the property's timezone to a timezone that is defined within the iCalendar object. Use setTimezoneId(String) to use a globally-defined timezone (e.g. "America/New_York").

Parameters:
timezone - the timezone component or null to remove
See Also:
RFC 5545 p.27-8

getSentBy

protected String getSentBy()
Gets a person that is acting on behalf of the person defined in the property.

Returns:
a URI representing the person (typically, an email URI, e.g. "mailto:janedoe@example.com") or null if not set
See Also:
RFC 5545 p.27

setSentBy

protected void setSentBy(String uri)
Sets a person that is acting on behalf of the person defined in the property.

Parameters:
uri - a URI representing the person (typically, an email URI, e.g. "mailto:janedoe@example.com") or null to remove
See Also:
RFC 5545 p.27

getCommonName

protected String getCommonName()
Gets the display name of the person.

Returns:
the display name (e.g. "John Doe") or null if not set
See Also:
RFC 5545 p.15-6

setCommonName

protected void setCommonName(String commonName)
Sets the display name of the person.

Parameters:
commonName - the display name (e.g. "John Doe") or null to remove
See Also:
RFC 5545 p.15-6

getDirectoryEntry

protected String getDirectoryEntry()
Gets a URI that contains additional information about the person.

Returns:
the URI (e.g. an LDAP URI) or null if not set
See Also:
RFC 5545 p.18

setDirectoryEntry

protected void setDirectoryEntry(String uri)
Sets a URI that contains additional information about the person.

Parameters:
uri - the URI (e.g. an LDAP URI) or null to remove
See Also:
RFC 5545 p.18

validate

public final List<String> validate(List<ICalComponent> components)
Checks the property for data consistency problems or deviations from the spec. These problems will not prevent the property from being written to a data stream, but may prevent it from being parsed correctly by the consuming application. These problems can largely be avoided by reading the Javadocs of the property class, or by being familiar with the iCalendar standard.

Parameters:
components - the hierarchy of components that the property belongs to
Returns:
a list of warnings or an empty list if no problems were found
See Also:
ICalendar.validate()

validate

protected void validate(List<ICalComponent> components,
                        List<String> warnings)
Checks the property for data consistency problems or deviations from the spec. Meant to be overridden by child classes.

Parameters:
components - the hierarchy of components that the property belongs to
warnings - the list to add the warnings to


Copyright © 2013 Michael Angstadt. All Rights Reserved.