Package net.fortuna.ical4j.model
Class Component
- java.lang.Object
-
- net.fortuna.ical4j.model.Content
-
- net.fortuna.ical4j.model.Component
-
- All Implemented Interfaces:
Serializable
,FluentComponent
,PropertyContainer
- Direct Known Subclasses:
Available
,CalendarComponent
,Observance
,Participant
,VLocation
,VResource
public abstract class Component extends Content implements Serializable, PropertyContainer, FluentComponent
$Id$ [Apr 5, 2004] Defines an iCalendar component. Subclasses of this class provide additional validation and typed values for specific iCalendar components.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.fortuna.ical4j.model.Content
Content.Factory
-
-
Field Summary
Fields Modifier and Type Field Description static String
AVAILABLE
Component token.static String
BEGIN
Component start token.protected ComponentList<? extends Component>
components
static String
END
Component end token.static String
EXPERIMENTAL_PREFIX
Prefix for non-standard components.static String
PARTICIPANT
Component token.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
VLOCATION
Component token.static String
VRESOURCE
Component token.static String
VTIMEZONE
Component token.static String
VTODO
Component token.static String
VVENUE
Component token.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Component(String s)
Constructs a new component containing no properties.protected
Component(String s, PropertyList p)
protected
Component(String s, PropertyList p, ComponentList<? extends Component> c)
Constructor made protected to enforce the use ofComponentFactory
for component instantiation.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <T extends Temporal>
Set<Period<T>>calculateRecurrenceSet(Period<T> period)
Calculates the recurrence set for this component using the specified period.<T extends Component>
Tcopy()
Create a (deep) copy of this component.boolean
equals(Object arg0)
<C extends Component>
CgetFluentTarget()
String
getName()
<T extends Property>
List<T>getProperties()
PropertyList
getPropertyList()
String
getValue()
int
hashCode()
protected abstract ComponentFactory<? extends Component>
newFactory()
Returns a new component factory used to create deep copies.void
setPropertyList(PropertyList properties)
String
toString()
ValidationResult
validate()
Perform validation on a component and its properties.abstract ValidationResult
validate(boolean recurse)
Perform validation on a component.protected ValidationResult
validateProperties()
Invoke validation on the component properties in its current state.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.fortuna.ical4j.model.FluentComponent
withProperty
-
Methods inherited from interface net.fortuna.ical4j.model.PropertyContainer
add, addAll, getProperties, getProperty, getRequiredProperty, remove, removeAll, replace
-
-
-
-
Field Detail
-
BEGIN
public static final String BEGIN
Component start token.- See Also:
- Constant Field Values
-
END
public static final String END
Component end token.- See Also:
- Constant Field Values
-
PARTICIPANT
public static final String PARTICIPANT
Component token.- See Also:
- Constant Field Values
-
VLOCATION
public static final String VLOCATION
Component token.- See Also:
- Constant Field Values
-
VRESOURCE
public static final String VRESOURCE
Component token.- See Also:
- Constant Field Values
-
VEVENT
public static final String VEVENT
Component token.- See Also:
- Constant Field Values
-
VTODO
public static final String VTODO
Component token.- See Also:
- Constant Field Values
-
VJOURNAL
public static final String VJOURNAL
Component token.- See Also:
- Constant Field Values
-
VFREEBUSY
public static final String VFREEBUSY
Component token.- See Also:
- Constant Field Values
-
VTIMEZONE
public static final String VTIMEZONE
Component token.- See Also:
- Constant Field Values
-
VALARM
public static final String VALARM
Component token.- See Also:
- Constant Field Values
-
VAVAILABILITY
public static final String VAVAILABILITY
Component token.- See Also:
- Constant Field Values
-
VVENUE
public static final String VVENUE
Component token.- See Also:
- Constant Field Values
-
AVAILABLE
public static final String AVAILABLE
Component token.- See Also:
- Constant Field Values
-
EXPERIMENTAL_PREFIX
public static final String EXPERIMENTAL_PREFIX
Prefix for non-standard components.- See Also:
- Constant Field Values
-
properties
protected PropertyList properties
-
components
protected ComponentList<? extends Component> components
-
-
Constructor Detail
-
Component
protected Component(String s)
Constructs a new component containing no properties.- Parameters:
s
- a component name
-
Component
protected Component(String s, PropertyList p)
-
Component
protected Component(String s, PropertyList p, ComponentList<? extends Component> c)
Constructor made protected to enforce the use ofComponentFactory
for component instantiation.- Parameters:
s
- component namep
- a list of properties
-
-
Method Detail
-
getName
public final String getName()
-
getValue
public String getValue()
-
getFluentTarget
public <C extends Component> C getFluentTarget()
- Specified by:
getFluentTarget
in interfaceFluentComponent
-
getPropertyList
public final PropertyList getPropertyList()
- Specified by:
getPropertyList
in interfacePropertyContainer
- Returns:
- Returns the underlying property list.
-
setPropertyList
public void setPropertyList(PropertyList properties)
- Specified by:
setPropertyList
in interfacePropertyContainer
-
validate
public ValidationResult validate() throws ValidationException
Perform validation on a component and its properties.- Throws:
ValidationException
- where the component is not in a valid state
-
validate
public abstract ValidationResult validate(boolean recurse) throws ValidationException
Perform validation on a component.- Parameters:
recurse
- indicates whether to validate the component's properties- Throws:
ValidationException
- where the component is not in a valid state
-
validateProperties
protected ValidationResult validateProperties() throws ValidationException
Invoke validation on the component properties in its current state.- Throws:
ValidationException
- where any of the component properties is not in a valid state
-
newFactory
protected abstract ComponentFactory<? extends Component> newFactory()
Returns a new component factory used to create deep copies.- Returns:
- a component factory instance
-
copy
public <T extends Component> T copy()
Create a (deep) copy of this component.- Returns:
- the component copy
-
calculateRecurrenceSet
public final <T extends Temporal> Set<Period<T>> calculateRecurrenceSet(Period<T> period)
Calculates the recurrence set for this component using the specified period. The recurrence set is derived from a combination of the component start date, recurrence rules and dates, and exception rules and dates. Note that component transparency and anniversary-style dates do not affect the resulting intersection.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.- Parameters:
period
- a range that defines the boundary for calculations- Returns:
- a list of periods representing component occurrences within the specified boundary
-
-