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 List |
getElementNamesForConflictResolution(List defaultList)
Sub classes should override if they wish to provide a different
combination of composite keys for determining conflicts.
|
protected abstract 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,
Map dMap,
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 Map |
parseRecurringMergeables(String tagName,
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 Map parseRecurringMergeables(String tagName, List compositeKeyList, Mergeable parentElement) throws 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)
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, Map dMap, Map rMap) throws 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)
Exception
- if there was an error merging both the maps.protected abstract String getTagNameForRecurringMergeable()
Mergeable
element that occurs multiple times.protected abstract List getElementNamesForConflictResolution(List defaultList)
AbstractMergeableSupport
getElementNamesForConflictResolution
in class AbstractMergeableSupport
Copyright © 2001-2019 Codehaus. All Rights Reserved.