public abstract class Component extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
AVAILABLE
Component token.
|
static String |
BEGIN
Component start token.
|
static String |
END
Component end token.
|
static String |
EXPERIMENTAL_PREFIX
Prefix for non-standard components.
|
static String |
VALARM
Component token.
|
static String |
VAVAILABILITY
Component token.
|
static String |
VEVENT
Component token.
|
static String |
VFREEBUSY
Component token.
|
static String |
VJOURNAL
Component token.
|
static String |
VTIMEZONE
Component token.
|
static String |
VTODO
Component token.
|
static String |
VVENUE
Component token.
|
Modifier | Constructor and Description |
---|---|
protected |
Component(String s)
Constructs a new component containing no properties.
|
protected |
Component(String s,
PropertyList p)
Constructor made protected to enforce the use of
ComponentFactory for component instantiation. |
Modifier and Type | Method and Description |
---|---|
<T extends Temporal> |
calculateRecurrenceSet(Period<T> period)
Calculates the recurrence set for this component using the specified period.
|
abstract Component |
copy()
Create a (deep) copy of this component.
|
boolean |
equals(Object arg0) |
String |
getName() |
PropertyList |
getProperties() |
List<Property> |
getProperties(String name)
Convenience method for retrieving a list of named properties.
|
<T extends Property> |
getProperty(String name)
Convenience method for retrieving a named property.
|
protected <T extends Property> |
getRequiredProperty(String name)
Convenience method for retrieving a required named property.
|
int |
hashCode() |
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 String BEGIN
public static final String END
public static final String VEVENT
public static final String VTODO
public static final String VJOURNAL
public static final String VFREEBUSY
public static final String VTIMEZONE
public static final String VALARM
public static final String VAVAILABILITY
public static final String VVENUE
public static final String AVAILABLE
public static final String EXPERIMENTAL_PREFIX
protected Component(String s)
s
- a component nameprotected Component(String s, PropertyList p)
ComponentFactory
for component instantiation.s
- component namep
- a list of propertiespublic final String getName()
public final PropertyList getProperties()
public final List<Property> getProperties(String name)
name
- name of properties to retrievepublic <T extends Property> T getProperty(String name)
name
- name of the property to retrieveprotected final <T extends Property> T getRequiredProperty(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 abstract Component copy() throws URISyntaxException, ParseException
URISyntaxException
ParseException
public final <T extends Temporal> List<Period<T>> calculateRecurrenceSet(Period<T> 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
NOTE: As a component may be defined in terms of floating date-time values (i.e. without a specific timezone), when calculating a recurrence set we must explicitly provide an applicable timezone for calculations.period
- a range that defines the boundary for calculations