Class AbstractMergeableElementList

    • Constructor Detail

      • AbstractMergeableElementList

        public AbstractMergeableElementList​(org.jdom2.Element element)
    • Method Detail

      • parseRecurringMergeables

        protected Map parseRecurringMergeables​(String tagName,
                                               List compositeKeyList,
                                               Mergeable parentElement)
                                        throws Exception
        Parses <component> elements and builds a map keyed basd on the list of composite keys specified.
        Parameters:
        tagName - Name of the tag that appears multiple times
        compositeKeyList - List of element/tag names to be used as composite keys to register recurring Mergeable instances.
        parentElement - Mergeable.
        Returns:
        Map of Mergeable instances keyed on the composite key obtained from getElementNamesForConflictResolution(java.util.List)
        Throws:
        Exception - if there was an error parsing and registering Mergeable instances
      • merge

        protected void merge​(org.jdom2.Element parent,
                             Map dMap,
                             Map rMap)
                      throws Exception
        Identifies the conflicting elements in the dominant and recessive Map instance and merges as required.
        Parameters:
        parent - Element that is parent for the children in the dominant Map instance. Merged content is added to this element.
        dMap - Dominant Map keyed by the composite key obtained from getElementNamesForConflictResolution(List)
        rMap - Recessive Map keyed by the composite key obtained from getElementNamesForConflictResolution(List)
        Throws:
        Exception - if there was an error merging both the maps.
      • getTagNameForRecurringMergeable

        protected abstract String getTagNameForRecurringMergeable()
        Allows the sub classes to provided a tag name that they expect to recurr within them. For instance:
        • <components> expects <component> to recurr within itself.
        • <requirements> expects <requirement> to recurr within itself.
        Returns:
        tag name of the Mergeable element that occurs multiple times.