public abstract class Component extends Content implements Serializable
Content.Factory
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.
|
protected PropertyList |
properties |
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 Component> |
add(Property property)
Add a property to the component's property list.
|
<T extends Temporal> |
calculateRecurrenceSet(Period<T> period)
Calculates the recurrence set for this component using the specified period.
|
Component |
copy()
Create a (deep) copy of this component.
|
boolean |
equals(Object arg0) |
String |
getName() |
PropertyList |
getProperties() |
List<Property> |
getProperties(String name)
Deprecated.
|
<T extends Property> |
getProperty(String name)
Deprecated.
|
<T extends Property> |
getRequiredProperty(String name)
Deprecated.
|
String |
getValue() |
int |
hashCode() |
protected abstract ComponentFactory<?> |
newFactory()
Returns a new component factory used to create deep copies.
|
<T extends Component> |
remove(Property property)
Remove a property from the component's property list.
|
<T extends Component> |
removeAll(String... propertyName)
Remove all properties from the component's property list with the matching property name.
|
<T extends Component> |
replace(Property property)
Add a property to the component's property list whilst removing all other properties with the same property name.
|
protected void |
setProperties(PropertyList properties) |
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 PropertyList properties
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 String getValue()
public final PropertyList getProperties()
public <T extends Component> T add(Property property)
property
- the property to addpublic <T extends Component> T remove(Property property)
property
- the property to removepublic <T extends Component> T removeAll(String... propertyName)
propertyName
- name of the properties to removepublic <T extends Component> T replace(Property property)
property
- the property to add@Deprecated public final List<Property> getProperties(String name)
ContentContainer.get(String)
name
- name of properties to retrieveprotected void setProperties(PropertyList properties)
@Deprecated public <T extends Property> Optional<T> getProperty(String name)
ContentContainer.getFirst(String)
name
- name of the property to retrieve@Deprecated public final <T extends Property> T getRequiredProperty(String name) throws ConstraintViolationException
ContentContainer.getRequired(String)
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 stateprotected abstract ComponentFactory<?> newFactory()
public Component copy()
public final <T extends Temporal> Set<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