biweekly.property
Class Version

java.lang.Object
  extended by biweekly.property.ICalProperty
      extended by biweekly.property.Version

public class Version
extends ICalProperty

Specifies the min/max versions a consumer must support in order to successfully parse the iCalendar object.

Examples:

 //the default iCal version
 Version version = Version.v2_0();
 
 if (verison.isV2_0()) {
        //version is "2.0"
 }
 

Author:
Michael Angstadt
Specification Reference:
RFC 5545 p.79-80

Field Summary
 
Fields inherited from class biweekly.property.ICalProperty
parameters
 
Constructor Summary
Version(String version)
          Creates a new version property.
Version(String minVersion, String maxVersion)
          Creates a new version property.
 
Method Summary
 String getMaxVersion()
          Gets the maximum version that a consumer must support in order to successfully parse the iCalendar object.
 String getMinVersion()
          Gets the minimum version that a consumer must support in order to successfully parse the iCalendar object.
 boolean isV2_0()
          Determines if this version is the default iCalendar version.
 void setMaxVersion(String maxVersion)
          Sets the maximum version that a consumer must support in order to successfully parse the iCalendar object.
 void setMinVersion(String minVersion)
          Sets the minimum version that a consumer must support in order to successfully parse the iCalendar object.
static Version v2_0()
          Creates a version property that is set to the default iCalendar version (2.0).
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 biweekly.property.ICalProperty
addParameter, getParameter, getParameters, getParameters, removeParameter, setParameter, setParameter, setParameters, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Version

public Version(String version)
Creates a new version property.

Parameters:
version - the version that a consumer must support in order to successfully parse the iCalendar object

Version

public Version(String minVersion,
               String maxVersion)
Creates a new version property.

Parameters:
minVersion - the minimum version that a consumer must support in order to successfully parse the iCalendar object
maxVersion - the maximum version that a consumer must support in order to successfully parse the iCalendar object
Method Detail

v2_0

public static Version v2_0()
Creates a version property that is set to the default iCalendar version (2.0).

Returns:
the property instance

isV2_0

public boolean isV2_0()
Determines if this version is the default iCalendar version.

Returns:
true if the version is "2.0", false if not

getMinVersion

public String getMinVersion()
Gets the minimum version that a consumer must support in order to successfully parse the iCalendar object.

Returns:
the minimum version or null if not set

setMinVersion

public void setMinVersion(String minVersion)
Sets the minimum version that a consumer must support in order to successfully parse the iCalendar object.

Parameters:
minVersion - the minimum version or null to remove

getMaxVersion

public String getMaxVersion()
Gets the maximum version that a consumer must support in order to successfully parse the iCalendar object.

Returns:
the maximum version or null if not set

setMaxVersion

public void setMaxVersion(String maxVersion)
Sets the maximum version that a consumer must support in order to successfully parse the iCalendar object.

Parameters:
maxVersion - the maximum version (this field is required)

validate

protected void validate(List<ICalComponent> components,
                        List<String> warnings)
Description copied from class: ICalProperty
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.

Overrides:
validate in class ICalProperty
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.