public abstract class AbstractMergeableElementList extends AbstractMergeableElement
AbstractMergeableElement
which is what
this actually is, but with added bits for merging child element lists.element
Constructor and Description |
---|
AbstractMergeableElementList(org.jdom.Element element) |
Modifier and Type | Method and Description |
---|---|
protected abstract java.util.List |
getElementNamesForConflictResolution(java.util.List defaultList)
Sub classes should override if they wish to provide a different
combination of composite keys for determining conflicts.
|
protected abstract java.lang.String |
getTagNameForRecurringMergeable()
Allows the sub classes to provided a tag name that they expect to recurr
within them.
|
protected void |
merge(org.jdom.Element parent,
java.util.Map dMap,
java.util.Map rMap)
Identifies the conflicting elements in the dominant and recessive
Map instance and merges as required. |
void |
merge(Mergeable me)
Merges an element of same type.
|
protected java.util.Map |
parseRecurringMergeables(java.lang.String tagName,
java.util.List compositeKeyList,
Mergeable parentElement)
Parses <component> elements and builds a map keyed basd on the list of composite keys specified.
|
isRecessiveElementInConflict, isRecessiveElementInConflict, merge, mergeableElementComesFromRecessive
addContent, addContent, addContent, addContent, addContent, addNamespaceDeclaration, clone, cloneContent, detach, equals, getAdditionalNamespaces, getAttribute, getAttribute, getAttributes, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValue, getChild, getChild, getChildren, getChildren, getChildren, getChildText, getChildText, getChildTextNormalize, getChildTextNormalize, getChildTextTrim, getChildTextTrim, getContent, getContent, getContent, getContentSize, getDefaultMergeStrategy, getDescendants, getDescendants, getDocument, getElement, getName, getNamespace, getNamespace, getNamespacePrefix, getNamespaceURI, getParent, getParentElement, getQualifiedName, getText, getTextNormalize, getTextTrim, getValue, hashCode, indexOf, isAncestor, isExpectedElementType, isRootElement, removeAttribute, removeAttribute, removeAttribute, removeChild, removeChild, removeChildren, removeChildren, removeContent, removeContent, removeContent, removeContent, removeNamespaceDeclaration, setAttribute, setAttribute, setAttribute, setAttributes, setContent, setContent, setContent, setContent, setName, setNamespace, setText, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
getAllowedTags
public AbstractMergeableElementList(org.jdom.Element element)
protected java.util.Map parseRecurringMergeables(java.lang.String tagName, java.util.List compositeKeyList, Mergeable parentElement) throws java.lang.Exception
tagName
- Name of the tag that appears multiple timescompositeKeyList
- List of element/tag names to be used as composite keys to register recurring
Mergeable
instances.Mergeable
instances keyed on the composite key obtained from
getElementNamesForConflictResolution(java.util.List)
java.lang.Exception
- if there was an error parsing and registering Mergeable
instancespublic void merge(Mergeable me) throws MergeException
Mergeable
merge
in interface Mergeable
merge
in class AbstractMergeableElement
me
- Another entity that is mergeable.MergeException
- if there was an error merging the mergeables.protected void merge(org.jdom.Element parent, java.util.Map dMap, java.util.Map rMap) throws java.lang.Exception
Map
instance and merges as required.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)
java.lang.Exception
- if there was an error merging both the maps.protected abstract java.lang.String getTagNameForRecurringMergeable()
Mergeable
element that occurs multiple times.protected abstract java.util.List getElementNamesForConflictResolution(java.util.List defaultList)
AbstractMergeableSupport
getElementNamesForConflictResolution
in class AbstractMergeableSupport