|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiweekly.component.ICalComponent
public abstract class ICalComponent
The base class for iCalendar components.
Field Summary | |
---|---|
protected ListMultimap<Class<? extends ICalComponent>,ICalComponent> |
components
|
protected ListMultimap<Class<? extends ICalProperty>,ICalProperty> |
properties
|
Constructor Summary | |
---|---|
ICalComponent()
|
Method Summary | ||
---|---|---|
void |
addComponent(ICalComponent component)
Adds a sub-component to this component. |
|
RawComponent |
addExperimentalComponent(String name)
Adds an experimental sub-component to this component. |
|
RawProperty |
addExperimentalProperty(String name,
ICalDataType dataType,
String value)
Adds an experimental property to this component. |
|
RawProperty |
addExperimentalProperty(String name,
String value)
Adds an experimental property to this component. |
|
void |
addProperty(ICalProperty property)
Adds a property to this component. |
|
protected void |
checkOptionalCardinality(List<String> warnings,
Class<? extends ICalProperty>... classes)
Utility method for validating that there is no more than one instance of each of the given properties. |
|
protected void |
checkRequiredCardinality(List<String> warnings,
Class<? extends ICalProperty>... classes)
Utility method for validating that there is exactly one instance of each of the given properties. |
|
|
getComponent(Class<T> clazz)
Gets the first component of a given class. |
|
ListMultimap<Class<? extends ICalComponent>,ICalComponent> |
getComponents()
Gets all the sub-components associated with this component. |
|
|
getComponents(Class<T> clazz)
Gets all components of a given class. |
|
RawComponent |
getExperimentalComponent(String name)
Gets the first experimental sub-component with a given name. |
|
List<RawComponent> |
getExperimentalComponents()
Gets all experimental sub-components associated with this component. |
|
List<RawComponent> |
getExperimentalComponents(String name)
Gets all experimental sub-component with a given name. |
|
List<RawProperty> |
getExperimentalProperties()
Gets all experimental properties associated with this component. |
|
List<RawProperty> |
getExperimentalProperties(String name)
Gets all experimental properties with a given name. |
|
RawProperty |
getExperimentalProperty(String name)
Gets the first experimental property with a given name. |
|
ListMultimap<Class<? extends ICalProperty>,ICalProperty> |
getProperties()
Gets all the properties associated with this component. |
|
|
getProperties(Class<T> clazz)
Gets all properties of a given class. |
|
|
getProperty(Class<T> clazz)
Gets the first property of a given class. |
|
void |
removeExperimentalComponents(String name)
Removes all experimental sub-components that have the given name. |
|
void |
removeExperimentalProperty(String name)
Removes all experimental properties that have the given name. |
|
void |
removeProperties(Class<? extends ICalProperty> clazz)
Removes properties from the iCalendar object. |
|
|
setComponent(Class<T> clazz,
T component)
Replaces all components of a given class with the given component. |
|
void |
setComponent(ICalComponent component)
Replaces all components of a given class with the given component. |
|
RawComponent |
setExperimentalComponents(String name)
Adds an experimental sub-component to this component, removing all existing components that have the same name. |
|
RawProperty |
setExperimentalProperty(String name,
ICalDataType dataType,
String value)
Adds an experimental property to this component, removing all existing properties that have the same name. |
|
RawProperty |
setExperimentalProperty(String name,
String value)
Adds an experimental property to this component, removing all existing properties that have the same name. |
|
|
setProperty(Class<T> clazz,
T property)
Replaces all existing properties of the given class with a single property instance. |
|
void |
setProperty(ICalProperty property)
Replaces all existing properties of the given class with a single property instance. |
|
List<ValidationWarnings.WarningsGroup> |
validate(List<ICalComponent> hierarchy)
Checks the component for data consistency problems or deviations from the spec. |
|
protected void |
validate(List<ICalComponent> components,
List<String> warnings)
Checks the component for data consistency problems or deviations from the spec. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final ListMultimap<Class<? extends ICalComponent>,ICalComponent> components
protected final ListMultimap<Class<? extends ICalProperty>,ICalProperty> properties
Constructor Detail |
---|
public ICalComponent()
Method Detail |
---|
public <T extends ICalProperty> T getProperty(Class<T> clazz)
clazz
- the property class
public <T extends ICalProperty> List<T> getProperties(Class<T> clazz)
clazz
- the property class
public ListMultimap<Class<? extends ICalProperty>,ICalProperty> getProperties()
public void addProperty(ICalProperty property)
property
- the property to addpublic void setProperty(ICalProperty property)
property
- the property (must not be null)public <T extends ICalProperty> void setProperty(Class<T> clazz, T property)
clazz
- the property class (e.g. "Version.class")property
- the property or null to removepublic void removeProperties(Class<? extends ICalProperty> clazz)
clazz
- the class of the properties to remove (e.g. "Version.class")public RawProperty getExperimentalProperty(String name)
name
- the property name (e.g. "X-ALT-DESC")
public List<RawProperty> getExperimentalProperties(String name)
name
- the property name (e.g. "X-ALT-DESC")
public List<RawProperty> getExperimentalProperties()
public RawProperty addExperimentalProperty(String name, String value)
name
- the property name (e.g. "X-ALT-DESC")value
- the property value
public RawProperty addExperimentalProperty(String name, ICalDataType dataType, String value)
name
- the property name (e.g. "X-ALT-DESC")dataType
- the property's data type (e.g. "text") or null if unknownvalue
- the property value
public RawProperty setExperimentalProperty(String name, String value)
name
- the property name (e.g. "X-ALT-DESC")value
- the property value
public RawProperty setExperimentalProperty(String name, ICalDataType dataType, String value)
name
- the property name (e.g. "X-ALT-DESC")dataType
- the property's data type (e.g. "text") or null if unknownvalue
- the property value
public void removeExperimentalProperty(String name)
name
- the component name (e.g. "X-ALT-DESC")public <T extends ICalComponent> T getComponent(Class<T> clazz)
clazz
- the component class
public <T extends ICalComponent> List<T> getComponents(Class<T> clazz)
clazz
- the component class
public ListMultimap<Class<? extends ICalComponent>,ICalComponent> getComponents()
public void addComponent(ICalComponent component)
component
- the component to addpublic void setComponent(ICalComponent component)
component
- the component (must not be null)public <T extends ICalComponent> void setComponent(Class<T> clazz, T component)
clazz
- the component's classcomponent
- the component or null to removepublic RawComponent getExperimentalComponent(String name)
name
- the component name (e.g. "X-PARTY")
public List<RawComponent> getExperimentalComponents(String name)
name
- the component name (e.g. "X-PARTY")
public List<RawComponent> getExperimentalComponents()
public RawComponent addExperimentalComponent(String name)
name
- the component name (e.g. "X-PARTY")
public RawComponent setExperimentalComponents(String name)
name
- the component name (e.g. "X-PARTY")
public void removeExperimentalComponents(String name)
name
- the component name (e.g. "X-PARTY")public final List<ValidationWarnings.WarningsGroup> validate(List<ICalComponent> hierarchy)
hierarchy
- the hierarchy of components that the component belongs
to
ICalendar.validate()
protected void validate(List<ICalComponent> components, List<String> warnings)
components
- the hierarchy of components that the component belongs
towarnings
- the list to add the warnings toprotected void checkRequiredCardinality(List<String> warnings, Class<? extends ICalProperty>... classes)
warnings
- the list to add the warnings toclasses
- the properties to checkprotected void checkOptionalCardinality(List<String> warnings, Class<? extends ICalProperty>... classes)
warnings
- the list to add the warnings toclasses
- the properties to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |