Class VParentBase<T>

java.lang.Object
jfxtras.icalendarfx.VElementBase
jfxtras.icalendarfx.VParentBase<T>
All Implemented Interfaces:
VElement, VParent
Direct Known Subclasses:
RecurrenceRuleValue, VCalendar, VComponentBase, VPropertyBase

public abstract class VParentBase<T> extends VElementBase implements VParent

Base class for parent calendar components.

The order of the children from childrenUnmodifiable() equals the order they were added. Adding children is not exposed by the implementation, but rather handled internally. When a VChild has its value set, it's automatically included in the collection of children by the Orderer.

The Orderer requires registering listeners to child properties.

  • Field Details

  • Constructor Details

    • VParentBase

      public VParentBase()
    • VParentBase

      public VParentBase(VParentBase<T> source)
  • Method Details

    • orderChild

      public void orderChild(VChild addedChild)
      Return the Orderer for this VParent
      Specified by:
      orderChild in interface VParent
    • orderChild

      public void orderChild(VChild oldChild, VChild newChild)
      Description copied from interface: VParent
      Replace the oldChild with the newChild in the ordered list
      Specified by:
      orderChild in interface VParent
    • orderChild

      public void orderChild(int index, VChild addedChild)
      Description copied from interface: VParent
      Insert the child at the index in the ordered list
      Specified by:
      orderChild in interface VParent
    • addChild

      public void addChild(VChild child)
      Description copied from interface: VParent
      Add child element to parent.
      Specified by:
      addChild in interface VParent
      Parameters:
      child - element to add to ordered list
    • addChild

      public void addChild(int index, VChild child)
      Specified by:
      addChild in interface VParent
      Parameters:
      index - index where child element is to be put
      child - element to add to ordered list
    • addChild

      public void addChild(String childContent)
      Description copied from interface: VParent
      Add child element to parent by parsing content text
      Specified by:
      addChild in interface VParent
    • removeChild

      public boolean removeChild(VChild child)
      Description copied from interface: VParent
      Remove child from parent.
      Specified by:
      removeChild in interface VParent
      Parameters:
      child - element to add to ordered list
      Returns:
      true is success, false if failure
    • removeChild

      public boolean removeChild(int index)
      Specified by:
      removeChild in interface VParent
      Parameters:
      index - index of child element to be removed
      Returns:
      true is success, false if failure
    • replaceChild

      public boolean replaceChild(int index, VChild child)
      Specified by:
      replaceChild in interface VParent
      Parameters:
      index - index of old child element to be removed
      child - new child element to put at index
      Returns:
    • replaceChild

      public boolean replaceChild(VChild oldChild, VChild newChild)
      Specified by:
      replaceChild in interface VParent
      Parameters:
      oldChild - old child element to be removed
      newChild - new child element to put at index where oldChild was
      Returns:
    • withChild

      public T withChild(VChild child)
    • getSetters

      protected Map<Class<? extends VChild>,Method> getSetters()
    • getGetters

      protected Map<Class<? extends VChild>,Method> getGetters()
    • getSetter

      protected Method getSetter(VChild child)
    • getGetter

      protected Method getGetter(VChild child)
    • parseContent

      protected List<VElementBase.Message> parseContent(String content)
      Description copied from class: VElementBase
      Parse content line into calendar element. If element contains children VElementBase.parseContent(String) is invoked recursively to parse child elements also
      Specified by:
      parseContent in class VElementBase
      Parameters:
      content - calendar content string to parse
      Returns:
      log of information and error messages
    • parseContent

      protected List<VElementBase.Message> parseContent(Iterator<String> unfoldedLineIterator)
    • processInLineChild

      protected void processInLineChild(List<VElementBase.Message> messages, String childName, String content, Class<? extends VElement> singleLineChildClass)
    • checkChild

      protected boolean checkChild(List<VElementBase.Message> messages, String content, String elementName, VChild newChild)
    • addChildInternal

      protected void addChildInternal(List<VElementBase.Message> messages, String content, String elementName, VChild newChild)
    • childrenUnmodifiable

      public List<VChild> childrenUnmodifiable()
      Description copied from interface: VParent

      Returns unmodifiable list of VChild elements.

      Specified by:
      childrenUnmodifiable in interface VParent
      Returns:
      unmodifiable list of children
    • copyChildrenInto

      public void copyChildrenInto(VParent destination)
    • 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
      Returns:
      - list of error messages
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • collectGetterMap

      public static Map<Class<? extends VChild>,Method> collectGetterMap(Class<?> class1)
    • collectSetterMap

      public static Map<Class<? extends VChild>,Method> collectSetterMap(Class<?> class1)