Class VPropertyBase<T,U>

java.lang.Object
jfxtras.icalendarfx.VElementBase
jfxtras.icalendarfx.VParentBase<U>
jfxtras.icalendarfx.properties.VPropertyBase<T,U>
Type Parameters:
U - - type of implementing subclass
T - - type of property value
All Implemented Interfaces:
VProperty<T>, VChild, VElement, VParent
Direct Known Subclasses:
Action, Attachment, CalendarScale, Classification, FreeBusyTime, GeographicPosition, Method, PercentComplete, Priority, ProductIdentifier, PropBaseDateTime, PropBaseLanguage, PropBaseUTC, PropertyBaseZoneOffset, RecurrenceRule, RelatedTo, RepeatCount, Sequence, Status, TimeTransparency, TimeZoneIdentifier, TimeZoneURL, Trigger, UniformResourceLocator, UniqueIdentifier, Version

public abstract class VPropertyBase<T,U> extends VParentBase<U> implements VProperty<T>
Base iCalendar property class Contains property value, value parameter (ValueType) and other-parameters Also contains several support methods used by other properties concrete subclasses
See Also:
  • Field Details

    • myParent

      private VParent myParent
    • value

      private T value
    • valueClass

      private Class<T> valueClass
    • propertyName

      protected String propertyName
    • propertyType

      private final VPropertyElement propertyType
    • unknownValue

      private String unknownValue
    • defaultValueType

      protected final ValueType defaultValueType
      VALUE TYPE Value Data Types RFC 5545, 3.2.20, page 29 To specify the value for text values in a property or property parameter. This parameter is optional for properties when the default value type is used. Examples: VALUE=DATE-TIME (Date-Time is default value, so it isn't necessary to specify) VALUE=DATE
    • allowedValueTypes

      protected final Collection<ValueType> allowedValueTypes
    • valueType

      private ValueParameter valueType
    • nonStandardParams

      private List<NonStandardParameter> nonStandardParams

      NON-STANDARD PARAMETERS

      x-param = x-name "=" param-value *("," param-value)
      ; A non-standard, experimental parameter.

    • actualValueContent

      protected String actualValueContent
    • converter

      private StringConverter<T> converter
  • Constructor Details

    • VPropertyBase

      protected VPropertyBase()
    • VPropertyBase

      public VPropertyBase(Class<T> valueClass, String contentLine)
    • VPropertyBase

      public VPropertyBase(VPropertyBase<T,U> source)
    • VPropertyBase

      public VPropertyBase(T value)
  • Method Details

    • setParent

      public void setParent(VParent parent)
      Description copied from interface: VChild
      Set the VParent of this VChild. This method is invoked internally by the API. Under normal circumstances it should not be used externally
      Specified by:
      setParent in interface VChild
    • getParent

      public VParent getParent()
      Description copied from interface: VChild
      Gets the VParent of this VChild
      Specified by:
      getParent in interface VChild
    • getValue

      public T getValue()
      PROPERTY VALUE Example: for the property content LOCATION:The park the property value is the string "The park"
      Specified by:
      getValue in interface VProperty<T>
    • setValue

      public void setValue(T value)
      Description copied from interface: VProperty
      Set the value of the property
      Specified by:
      setValue in interface VProperty<T>
    • withValue

      public U withValue(T value)
    • valueContent

      protected String valueContent()
      The propery's value converted by string converted to content string
    • getValueClass

      private Class<?> getValueClass()
    • name

      public String name()
      The name of the property, such as DESCRIPTION Remains the default value unless set by a non-standard property
      Specified by:
      name in interface VElement
      Returns:
      - the component name
    • getUnknownValue

      protected String getUnknownValue()
    • setUnknownValue

      private void setUnknownValue(String value)
    • getValueType

      public ValueParameter getValueType()
      Description copied from interface: VProperty
      VALUE Value Date Types RFC 5545 iCalendar 3.2.10 page 29 To explicitly specify the value type format for a property value. Property value type. Optional if default type is used. Example: VALUE=DATE
      Specified by:
      getValueType in interface VProperty<T>
    • setValueType

      public void setValueType(ValueParameter valueType)
      Description copied from interface: VProperty
      Set the value type
      Specified by:
      setValueType in interface VProperty<T>
    • setValueType

      public void setValueType(ValueType value)
    • withValueType

      public U withValueType(ValueType value)
    • valueParamenterConverter

      private void valueParamenterConverter(ValueParameter newValueParameter)
    • getNonStandard

      public List<NonStandardParameter> getNonStandard()
      Description copied from interface: VProperty

      Non-Standard Parameters

      x-param = x-name "=" param-value *("," param-value)
      ; A non-standard, experimental parameter.

      Specified by:
      getNonStandard in interface VProperty<T>
    • setNonStandard

      public void setNonStandard(List<NonStandardParameter> nonStandardParams)
      Specified by:
      setNonStandard in interface VProperty<T>
    • withNonStandard

      public U withNonStandard(List<NonStandardParameter> nonStandardParams)
      Sets the value of the #NonStandardParameter()
      Returns:
      - this class for chaining
    • withNonStandard

      public U withNonStandard(String... nonStandardParams)
      NON-STANDARD PARAMETERS Sets the value of the #NonStandardParameter() by parsing a vararg of iCalendar content text representing individual NonStandardParameter objects.
      Returns:
      - this class for chaining
    • withNonStandard

      public U withNonStandard(NonStandardParameter... nonStandardParams)
      Sets the value of the #NonStandardParameter() from a vararg of NonStandardParameter objects.
      Returns:
      - this class for chaining
    • modifiedValue

      protected String modifiedValue()
    • getConverter

      protected StringConverter<T> getConverter()
      STRING CONVERTER Get the property's value string converter. There is a default converter in ValueType associated with the default value type of the property. For most value types that converter is acceptable. However, for the TEXT value type it often needs to be replaced. For example, the value type for TimeZoneIdentifier is TEXT, but the Java object is ZoneId. A different converter is required to make the conversion to ZoneId.
    • setConverter

      protected void setConverter(StringConverter<T> converter)
    • isCustomConverter

      private boolean isCustomConverter()
    • copyValue

      protected T copyValue(T source)
    • setConverterByClass

      protected void setConverterByClass(Class<T> valueClass)
    • parseContent

      protected List<VElementBase.Message> parseContent(String unfoldedContent)
      Handle non-standard property name
      Overrides:
      parseContent in class VParentBase<U>
      Parameters:
      unfoldedContent - calendar content string to parse
      Returns:
      log of information and error messages
    • processInLineChild

      protected void processInLineChild(List<VElementBase.Message> messages, String childName, String content, Class<? extends VElement> singleLineChildClass)
      Overrides:
      processInLineChild in class VParentBase<U>
    • errors

      public List<String> errors()
      Description copied from interface: VElement
      Produces a list of error messages indicating problems with calendar element VElement.errors() is invoked recursively to return errors of child elements in addition to errors in parent
      Specified by:
      errors in interface VElement
      Overrides:
      errors in class VParentBase<U>
      Returns:
      - list of error messages
    • isValueTypeValid

      private boolean isValueTypeValid(ValueType value)
    • toString

      public String toString()
      Overrides:
      toString in class VParentBase<U>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class VParentBase<U>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class VParentBase<U>