Class AbstractMergeableSupport
java.lang.Object
org.codehaus.plexus.metadata.merge.support.AbstractMergeableSupport
- All Implemented Interfaces:
Mergeable
- Direct Known Subclasses:
AbstractMergeableElement
- Author:
- khmarbaise
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.jdom2.ElementaddContent(int index, Collection c) org.jdom2.ElementaddContent(int index, org.jdom2.Content child) org.jdom2.ElementaddContent(String str) org.jdom2.ElementaddContent(Collection collection) org.jdom2.ElementaddContent(org.jdom2.Content child) voidaddNamespaceDeclaration(org.jdom2.Namespace additional) clone()org.jdom2.Contentdetach()booleanorg.jdom2.AttributegetAttribute(String name) org.jdom2.AttributegetAttribute(String name, org.jdom2.Namespace ns) getAttributeValue(String name) getAttributeValue(String name, String def) getAttributeValue(String name, org.jdom2.Namespace ns) getAttributeValue(String name, org.jdom2.Namespace ns, String def) org.jdom2.Elementorg.jdom2.ElementgetChildren(String name) getChildren(String name, org.jdom2.Namespace ns) getChildText(String name) getChildText(String name, org.jdom2.Namespace ns) getChildTextNormalize(String name) getChildTextNormalize(String name, org.jdom2.Namespace ns) getChildTextTrim(String name) getChildTextTrim(String name, org.jdom2.Namespace ns) org.jdom2.ContentgetContent(int index) getContent(org.jdom2.filter.Filter filter) intprotected MergeStrategyReturns the defaultMergeStrategyinstance.getDescendants(org.jdom2.filter.Filter filter) org.jdom2.Documentorg.jdom2.ElementReturns the wrapped up JDomElementinstance.protected ListgetElementNamesForConflictResolution(List defaultList) Sub classes should override if they wish to provide a different combination of composite keys for determining conflicts.getName()org.jdom2.Namespaceorg.jdom2.NamespacegetNamespace(String prefix) org.jdom2.Parentorg.jdom2.ElementgetText()getValue()inthashCode()intindexOf(org.jdom2.Content child) booleanisAncestor(org.jdom2.Element element) protected abstract booleanDetermines if the passed inMergeablewas of same type as this class.booleanabstract voidMerges an element of same type.booleanremoveAttribute(String name) booleanremoveAttribute(String name, org.jdom2.Namespace ns) booleanremoveAttribute(org.jdom2.Attribute attribute) booleanremoveChild(String name) booleanremoveChild(String name, org.jdom2.Namespace ns) booleanremoveChildren(String name) booleanremoveChildren(String name, org.jdom2.Namespace ns) org.jdom2.ContentremoveContent(int index) booleanremoveContent(org.jdom2.Content child) removeContent(org.jdom2.filter.Filter filter) voidremoveNamespaceDeclaration(org.jdom2.Namespace additionalNamespace) org.jdom2.ElementsetAttribute(String name, String value) org.jdom2.ElementsetAttribute(String name, String value, org.jdom2.Namespace ns) org.jdom2.ElementsetAttribute(org.jdom2.Attribute attribute) org.jdom2.ElementsetAttributes(List newAttributes) org.jdom2.ParentsetContent(int index, Collection collection) org.jdom2.ElementsetContent(int index, org.jdom2.Content child) org.jdom2.ElementsetContent(Collection newContent) org.jdom2.ElementsetContent(org.jdom2.Content child) org.jdom2.Elementorg.jdom2.ElementsetNamespace(org.jdom2.Namespace namespace) org.jdom2.ElementtoString()Element.toString()Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.codehaus.plexus.metadata.merge.support.Mergeable
getAllowedTags, merge
-
Field Details
-
element
protected org.jdom2.Element elementWrapped JDOM element.
-
-
Constructor Details
-
AbstractMergeableSupport
public AbstractMergeableSupport(org.jdom2.Element element) - Parameters:
element-Element
-
-
Method Details
-
merge
Merges an element of same type.- Specified by:
mergein interfaceMergeable- Parameters:
me- Another entity that is mergeable.- Throws:
MergeException- if there was an error merging the mergeables.
-
isExpectedElementType
Determines if the passed inMergeablewas of same type as this class.- Parameters:
me-Mergeableinstance to test.- Returns:
trueif the passed in Mergeable can be merged with the current Mergeable.
-
addContent
- Parameters:
collection-Collection- Returns:
Element.
-
addContent
public org.jdom2.Element addContent(org.jdom2.Content child) - Parameters:
child-Content- Returns:
Element.
-
addContent
- Parameters:
index- The index.c-Collection- Returns:
Element.
-
addContent
public org.jdom2.Element addContent(int index, org.jdom2.Content child) - Parameters:
index- The index.child-Content- Returns:
Element.
-
addContent
- Parameters:
str- The content to be added.- Returns:
Element.
-
addNamespaceDeclaration
public void addNamespaceDeclaration(org.jdom2.Namespace additional) - Parameters:
additional-Namespace
-
clone
-
cloneContent
-
detach
public org.jdom2.Content detach() -
equals
-
getAdditionalNamespaces
- Returns:
- list of Namespaces.
-
getAttribute
- Parameters:
name- The name.ns-Namespace- Returns:
Attribute
-
getAttribute
- Parameters:
name- The name of the attribute.- Returns:
Attribute
-
getAttributes
- Returns:
- list
Attribute
-
getAttributeValue
- Parameters:
name- The name of the attribute.ns- TheNamespacedef- the default value.- Returns:
- The value of the attribute.
- See Also:
-
getAttributeValue
- Parameters:
name- The name of the attribute.ns- TheNamespace- Returns:
- The value of the attribute.
- See Also:
-
getAttributeValue
- Parameters:
name- The name of the attribute.def- the default value.- Returns:
- The value of the attribute.
- See Also:
-
getAttributeValue
- Parameters:
name- The name of the attribute.- Returns:
- The value of the attribute.
- See Also:
-
getChild
- Parameters:
name- The name of the child.ns-Namespace- Returns:
Element- See Also:
-
getChild
- Parameters:
name- The name of the child.- Returns:
Element- See Also:
-
getChildren
- Returns:
- list of
Element - See Also:
-
getChildren
- Parameters:
name- The name of the child.ns-Namespace- Returns:
- list
Element - See Also:
-
getChildren
- Parameters:
name- The name.- Returns:
- list
Element - See Also:
-
getChildText
- Parameters:
name- The name of the child.ns-Namespace- Returns:
- the child text.
- See Also:
-
getChildText
- Parameters:
name- The name of the child.- Returns:
- the child text.
- See Also:
-
getChildTextNormalize
- Parameters:
name- The name of the child.ns-Namespace- Returns:
- the child text.
- See Also:
-
getChildTextNormalize
- Parameters:
name- The name of the child.- Returns:
- the child text.
- See Also:
-
getChildTextTrim
- Parameters:
name- The name of the child.ns-Namespace- Returns:
- the child text.
- See Also:
-
getChildTextTrim
- Parameters:
name- The name of the child.- Returns:
- the child text.
- See Also:
-
getContent
- Returns:
- list of content.
- See Also:
-
getContent
- Parameters:
filter-Filter- Returns:
- list of content.
- See Also:
-
getContent
public org.jdom2.Content getContent(int index) - Parameters:
index- The index.- Returns:
- the content.
- See Also:
-
getContentSize
public int getContentSize()- Returns:
- The content size.
- See Also:
-
getDescendants
- Returns:
Iteratorof descendants.- See Also:
-
getDescendants
- Parameters:
filter-Filter- Returns:
Iteratorof descendants.- See Also:
-
getDocument
public org.jdom2.Document getDocument()- Returns:
- the document.
- See Also:
-
getName
- Returns:
- The name of the element.
- See Also:
-
getNamespace
public org.jdom2.Namespace getNamespace()- Returns:
Namespace- See Also:
-
getNamespace
- Parameters:
prefix- The prefix.- Returns:
Namespace- See Also:
-
getNamespacePrefix
- Returns:
- the namespace prefix.
- See Also:
-
getNamespaceURI
- Returns:
- the namespace URI.
- See Also:
-
getParent
public org.jdom2.Parent getParent()- Returns:
- The parent.
- See Also:
-
getParentElement
public org.jdom2.Element getParentElement()- Returns:
- the parent
Element - See Also:
-
getQualifiedName
- Returns:
- The qualified name.
- See Also:
-
getText
- Returns:
- The text.
- See Also:
-
getTextNormalize
- Returns:
- the normalized text.
- See Also:
-
getTextTrim
- Returns:
- the trimmed text.
- See Also:
-
getValue
- Returns:
- the element value.
- See Also:
-
hashCode
public int hashCode() -
indexOf
public int indexOf(org.jdom2.Content child) - Parameters:
child- The child.- Returns:
- the index.
- See Also:
-
isAncestor
public boolean isAncestor(org.jdom2.Element element) - Parameters:
element-Element.- Returns:
- true/false.
- See Also:
-
isRootElement
public boolean isRootElement()- Returns:
- true/false.
- See Also:
-
removeAttribute
public boolean removeAttribute(org.jdom2.Attribute attribute) - Parameters:
attribute-Attribute- Returns:
- true/false.
- See Also:
-
removeAttribute
- Parameters:
name- The name of the attribute.ns- TheNamespace- Returns:
- true/false.
- See Also:
-
removeAttribute
- Parameters:
name- The mame of the attribute.- Returns:
- true/false.
- See Also:
-
removeChild
- Parameters:
name- The name of the child.ns-Namespace- Returns:
- true/false.
- See Also:
-
removeChild
- Parameters:
name- The name of the child.- Returns:
- true/false.
- See Also:
-
removeChildren
- Parameters:
name- The name of the child.ns-Namespace- Returns:
- true/false.
- See Also:
-
removeChildren
- Parameters:
name- name of the child.- Returns:
- true/false.
- See Also:
-
removeContent
- Returns:
- list of elements.
- See Also:
-
removeContent
public boolean removeContent(org.jdom2.Content child) - Parameters:
child-Content- Returns:
- true/false.
- See Also:
-
removeContent
- Parameters:
filter-Filter.- Returns:
- list of elements.
- See Also:
-
removeContent
public org.jdom2.Content removeContent(int index) - Parameters:
index- The index.- Returns:
Content- See Also:
-
removeNamespaceDeclaration
public void removeNamespaceDeclaration(org.jdom2.Namespace additionalNamespace) - Parameters:
additionalNamespace-Namespace.- See Also:
-
setAttribute
public org.jdom2.Element setAttribute(org.jdom2.Attribute attribute) - Parameters:
attribute-Attribute- Returns:
Element.- See Also:
-
setAttribute
- Parameters:
name- name of the attribute.value- The value of the attribute.ns-Namespace.- Returns:
Element- See Also:
-
setAttribute
- Parameters:
name- name of the attribute.value- The value of the attribute.- Returns:
Element- See Also:
-
setAttributes
- Parameters:
newAttributes- list of new attributes.- Returns:
Element
-
setContent
- Parameters:
newContent-Collection- Returns:
Element- See Also:
-
setContent
public org.jdom2.Element setContent(org.jdom2.Content child) - Parameters:
child-Content- Returns:
Element- See Also:
-
setContent
- Parameters:
index- The index.collection-Collection- Returns:
Parent- See Also:
-
setContent
public org.jdom2.Element setContent(int index, org.jdom2.Content child) - Parameters:
index- index.child-Content- Returns:
Element- See Also:
-
setName
- Parameters:
name- The name of the element.- Returns:
Element- See Also:
-
setNamespace
public org.jdom2.Element setNamespace(org.jdom2.Namespace namespace) - Parameters:
namespace-Namespace- Returns:
Element- See Also:
-
setText
- Parameters:
text- The text to be set.- Returns:
Element- See Also:
-
toString
Element.toString() -
getElement
public org.jdom2.Element getElement()Returns the wrapped up JDomElementinstance. Returns the wrapped up JDomElementinstance that was used to create this Mergeable.- Specified by:
getElementin interfaceMergeable- Returns:
- the wrapped up JDom
Elementinstance.
-
getElementNamesForConflictResolution
Sub classes should override if they wish to provide a different combination of composite keys for determining conflicts.- Parameters:
defaultList- the default list.- Returns:
- the default list.
-
getDefaultMergeStrategy
Returns the defaultMergeStrategyinstance.- Returns:
MergeStrategy
-