biweekly.property
Class ICalProperty

java.lang.Object
  extended by biweekly.property.ICalProperty
Direct Known Subclasses:
Attachment, DateOrDateTimeProperty, FreeBusy, Geo, ListProperty, RawProperty, RecurrenceDates, 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.
 String getParameter(String name)
          Gets the first value of a parameter with the given name.
 ICalParameters getParameters()
          Gets the property's parameters.
 List<String> getParameters(String name)
          Gets all values of a parameter with the given name.
 void removeParameter(String name)
          Removes a parameter from the property.
 void setParameter(String name, Collection<String> values)
          Replaces all existing values of a parameter with the given values.
 void setParameter(String name, String value)
          Replaces all existing values of a parameter with the given value.
 void setParameters(ICalParameters parameters)
          Sets the property's parameters
 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 a 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 a 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)
Replaces all existing values of a parameter with the given value.

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

setParameter

public void setParameter(String name,
                         Collection<String> values)
Replaces all existing values of a parameter with the given 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")

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 that wish to provide validation logic.

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.