net.fortuna.ical4j.model
Class Component

java.lang.Object
  extended bynet.fortuna.ical4j.model.Component
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CalendarComponent, Observance

public abstract class Component
extends Object
implements Serializable

Defines an iCalendar component. Subclasses of this class provide additional validation and typed values for specific iCalendar components.

Author:
Ben Fortuna
See Also:
Serialized Form

Field Summary
static String BEGIN
           
static String END
           
static String EXPERIMENTAL_PREFIX
           
static String VALARM
           
static String VEVENT
           
static String VFREEBUSY
           
static String VJOURNAL
           
static String VTIMEZONE
           
static String VTODO
           
 
Constructor Summary
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.
 
Method Summary
 boolean equals(Object arg0)
          Two components are equal if and only if their name and property lists are equal.
 String getName()
           
 PropertyList getProperties()
           
 PropertyList getProperties(String name)
          Convenience method for retrieving a list of named properties.
 Property getProperty(String name)
          Convenience method for retrieving a 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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BEGIN

public static final String BEGIN
See Also:
Constant Field Values

END

public static final String END
See Also:
Constant Field Values

VEVENT

public static final String VEVENT
See Also:
Constant Field Values

VTODO

public static final String VTODO
See Also:
Constant Field Values

VJOURNAL

public static final String VJOURNAL
See Also:
Constant Field Values

VFREEBUSY

public static final String VFREEBUSY
See Also:
Constant Field Values

VTIMEZONE

public static final String VTIMEZONE
See Also:
Constant Field Values

VALARM

public static final String VALARM
See Also:
Constant Field Values

EXPERIMENTAL_PREFIX

public static final String EXPERIMENTAL_PREFIX
See Also:
Constant Field Values
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)
Constructor made protected to enforce the use of ComponentFactory for component instantiation.

Parameters:
s - component name
p - a list of properties
Method Detail

toString

public String toString()
See Also:
Object.toString()

getName

public final String getName()
Returns:
Returns the name.

getProperties

public final PropertyList getProperties()
Returns:
Returns the properties.

getProperties

public final PropertyList getProperties(String name)
Convenience method for retrieving a list of named properties.

Parameters:
name - name of properties to retrieve
Returns:
a property list containing only properties with the specified name

getProperty

public final Property getProperty(String name)
Convenience method for retrieving a named property.

Parameters:
name - name of the property to retrieve
Returns:
the first matching property in the property list with the specified name

validate

public final void 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 void 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 final void 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

equals

public final boolean equals(Object arg0)
Two components are equal if and only if their name and property lists are equal.

See Also:
Object.equals(java.lang.Object)

hashCode

public final int hashCode()