Package com.atlassian.bamboo.upgrade
Class AbstractXmlUpgrader
java.lang.Object
com.atlassian.bamboo.upgrade.AbstractXmlUpgrader
- Direct Known Subclasses:
BuildDefinitionUpgrader
,ConfigurationUpgrader
An abstract Bamboo upgrader that will manipulate on raw XML.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
appendComment
(String comment, File file) Appends commend to filestatic org.dom4j.Element
asMap
(@NotNull org.dom4j.Element element) protected static void
closeQuietly
(org.dom4j.io.XMLWriter writer) protected abstract org.dom4j.Document
@Nullable org.dom4j.Element
getElement
(@NotNull String xpathExpression) @Nullable org.dom4j.Element
getElement
(@NotNull org.dom4j.Element parent, @NotNull String xpathExpression) @Nullable String
getElementText
(@NotNull org.dom4j.Element parent, @NotNull String elementName) org.dom4j.Element
protected static void
logChanges
(String xmlSourceIdentifier, String originalContent, String newContent) void
remove
(org.dom4j.Element element) abstract void
save()
static void
Save node contents to a file.void
void
setOrAdd
(@NotNull org.dom4j.Element element) void
void
setOrAdd
(@NotNull org.dom4j.Element parent, @NotNull org.dom4j.Element element) void
update
(org.dom4j.Element element)
-
Constructor Details
-
AbstractXmlUpgrader
public AbstractXmlUpgrader()
-
-
Method Details
-
getDocument
protected abstract org.dom4j.Document getDocument() -
save
- Throws:
IOException
-
setOrAdd
-
setOrAdd
-
setOrAdd
public void setOrAdd(@NotNull @NotNull org.dom4j.Element element) -
setOrAdd
public void setOrAdd(@NotNull @NotNull org.dom4j.Element parent, @NotNull @NotNull org.dom4j.Element element) -
update
public void update(org.dom4j.Element element) -
remove
public void remove(org.dom4j.Element element) -
getRootElement
public org.dom4j.Element getRootElement() -
getElement
-
getElement
@Nullable public @Nullable org.dom4j.Element getElement(@NotNull @NotNull org.dom4j.Element parent, @NotNull @NotNull String xpathExpression) -
asMap
-
asElement
-
saveNode
Save node contents to a file.- Parameters:
node
- element to be persistedfile
- destination file- Throws:
IOException
-
appendComment
Appends commend to file- Parameters:
comment
- comment text, without comment marksfile
- destination file- Throws:
IOException
-
getElementText
-
closeQuietly
protected static void closeQuietly(org.dom4j.io.XMLWriter writer) -
logChanges
-