public abstract class Component
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AVAILABLE
Component token.
|
static java.lang.String |
BEGIN
Component start token.
|
static java.lang.String |
END
Component end token.
|
static java.lang.String |
EXPERIMENTAL_PREFIX
Prefix for non-standard components.
|
static java.lang.String |
VALARM
Component token.
|
static java.lang.String |
VAVAILABILITY
Component token.
|
static java.lang.String |
VEVENT
Component token.
|
static java.lang.String |
VFREEBUSY
Component token.
|
static java.lang.String |
VJOURNAL
Component token.
|
static java.lang.String |
VTIMEZONE
Component token.
|
static java.lang.String |
VTODO
Component token.
|
static java.lang.String |
VVENUE
Component token.
|
Modifier | Constructor and Description |
---|---|
protected |
Component(java.lang.String s)
Constructs a new component containing no properties.
|
protected |
Component(java.lang.String s,
PropertyList<Property> p)
Constructor made protected to enforce the use of
ComponentFactory for component instantiation. |
Modifier and Type | Method and Description |
---|---|
PeriodList |
calculateRecurrenceSet(Period period)
Calculates the recurrence set for this component using the specified period.
|
Component |
copy()
Create a (deep) copy of this component.
|
boolean |
equals(java.lang.Object arg0) |
java.lang.String |
getName() |
PropertyList<Property> |
getProperties() |
<C extends Property> |
getProperties(java.lang.String name)
Convenience method for retrieving a list of named properties.
|
<T extends Property> |
getProperty(java.lang.String name)
Convenience method for retrieving a named property.
|
protected Property |
getRequiredProperty(java.lang.String name)
Convenience method for retrieving a required named property.
|
int |
hashCode() |
java.lang.String |
toString() |
void |
validate()
Perform validation on a component and its properties.
|
abstract void |
validate(boolean recurse)
Perform validation on a component.
|
protected void |
validateProperties()
Invoke validation on the component properties in its current state.
|
public static final java.lang.String BEGIN
public static final java.lang.String END
public static final java.lang.String VEVENT
public static final java.lang.String VTODO
public static final java.lang.String VJOURNAL
public static final java.lang.String VFREEBUSY
public static final java.lang.String VTIMEZONE
public static final java.lang.String VALARM
public static final java.lang.String VAVAILABILITY
public static final java.lang.String VVENUE
public static final java.lang.String AVAILABLE
public static final java.lang.String EXPERIMENTAL_PREFIX
protected Component(java.lang.String s)
s
- a component nameprotected Component(java.lang.String s, PropertyList<Property> p)
ComponentFactory
for component instantiation.s
- component namep
- a list of propertiespublic java.lang.String toString()
toString
in class java.lang.Object
public final java.lang.String getName()
public final PropertyList<Property> getProperties()
public final <C extends Property> PropertyList<C> getProperties(java.lang.String name)
name
- name of properties to retrievepublic final <T extends Property> T getProperty(java.lang.String name)
name
- name of the property to retrieveprotected final Property getRequiredProperty(java.lang.String name) throws ConstraintViolationException
name
- name of the property to retrieveConstraintViolationException
- when a property is not foundpublic final void validate() throws ValidationException
ValidationException
- where the component is not in a valid statepublic abstract void validate(boolean recurse) throws ValidationException
recurse
- indicates whether to validate the component's propertiesValidationException
- where the component is not in a valid stateprotected final void validateProperties() throws ValidationException
ValidationException
- where any of the component properties is not in a valid statepublic boolean equals(java.lang.Object arg0)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Component copy() throws java.text.ParseException, java.io.IOException, java.net.URISyntaxException
java.io.IOException
- where an error occurs reading the component datajava.text.ParseException
- where parsing component data failsjava.net.URISyntaxException
- where component data contains an invalid URIpublic final PeriodList calculateRecurrenceSet(Period period)
If an explicit DURATION is not specified, the effective duration of each returned period is derived from the DTSTART and DTEND or DUE properties. If the component has no DURATION, DTEND or DUE, the effective duration is set to PT0S
period
- a range to calculate recurrences for