biweekly.property
Class EnumProperty

java.lang.Object
  extended by biweekly.property.ICalProperty
      extended by biweekly.property.ValuedProperty<String>
          extended by biweekly.property.TextProperty
              extended by biweekly.property.EnumProperty
Direct Known Subclasses:
Action, CalendarScale, Classification, Status, Transparency

public abstract class EnumProperty
extends TextProperty

Parent class for properties that have a defined set of acceptable values (for example, Action).

Author:
Michael Angstadt

Field Summary
 
Fields inherited from class biweekly.property.ValuedProperty
value
 
Fields inherited from class biweekly.property.ICalProperty
parameters
 
Constructor Summary
EnumProperty(String value)
          Creates an enum property.
 
Method Summary
protected abstract  Collection<String> getStandardValues()
          Gets the list of acceptable values for this property.
protected  boolean is(String value)
          Compares the property's value with a given string (case-insensitive).
protected  void validate(List<ICalComponent> components, List<String> warnings)
          Checks the property for data consistency problems or deviations from the spec.
 
Methods inherited from class biweekly.property.ValuedProperty
getValue, setValue
 
Methods inherited from class biweekly.property.ICalProperty
addParameter, getParameter, getParameters, getParameters, removeParameter, setParameter, setParameter, setParameters, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumProperty

public EnumProperty(String value)
Creates an enum property.

Parameters:
value - the property value
Method Detail

is

protected boolean is(String value)
Compares the property's value with a given string (case-insensitive).

Parameters:
value - the string
Returns:
true if it's equal, false if not

getStandardValues

protected abstract Collection<String> getStandardValues()
Gets the list of acceptable values for this property.

Returns:
the list of acceptable values

validate

protected void validate(List<ICalComponent> components,
                        List<String> warnings)
Description copied from class: ICalProperty
Checks the property for data consistency problems or deviations from the spec. Meant to be overridden by child classes that wish to provide validation logic.

Overrides:
validate in class ValuedProperty<String>
Parameters:
components - the hierarchy of components that the property belongs to
warnings - the list to add the warnings to


Copyright © 2013 Michael Angstadt. All Rights Reserved.