Interface ChildElement<T extends ModelElementInstance>

Type Parameters:
T - the type of the child element
All Superinterfaces:
ChildElementCollection<T>
All Known Implementing Classes:
ChildElementImpl

public interface ChildElement<T extends ModelElementInstance> extends ChildElementCollection<T>
A single child element (child Element collection where ChildElementCollection.getMaxOccurs() returns 1. The Collection.add(Object) operation provided by this collection has special behavior: it will replace an existing element if it exists.
Author:
Daniel Meyer
  • Method Details

    • setChild

      void setChild(ModelElementInstance element, T newChildElement)
      Sets the child element, potentially replacing an existing child element.
      Parameters:
      element - the parent element of the child element
      newChildElement - the new child element to set
    • getChild

      T getChild(ModelElementInstance element)
      Returns the child element.
      Parameters:
      element - the parent element of the child element
      Returns:
      the child element of the parent, or null if not exist
    • removeChild

      boolean removeChild(ModelElementInstance element)
      Removes the child element.
      Parameters:
      element - the parent element of the child element
      Returns:
      true if the child was remove otherwise false