Package com.atlassian.bamboo.upgrade
Class AbstractXmlUpgrader
- java.lang.Object
-
- com.atlassian.bamboo.upgrade.AbstractXmlUpgrader
-
- Direct Known Subclasses:
BuildDefinitionUpgrader
,ConfigurationUpgrader
public abstract class AbstractXmlUpgrader extends Object
An abstract Bamboo upgrader that will manipulate on raw XML.
-
-
Constructor Summary
Constructors Constructor Description AbstractXmlUpgrader()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static void
appendComment(String comment, File file)
Appends commend to filestatic org.dom4j.Element
asElement(Map<String,String> artifactHandlerConfiguration, String name)
static Map<String,String>
asMap(@NotNull org.dom4j.Element element)
protected static void
closeQuietly(org.dom4j.io.XMLWriter writer)
protected abstract org.dom4j.Document
getDocument()
@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
getRootElement()
protected static void
logChanges(String xmlSourceIdentifier, String originalContent, String newContent)
void
remove(org.dom4j.Element element)
abstract void
save()
static void
saveNode(org.dom4j.Node node, File file)
Save node contents to a file.void
setOrAdd(@NotNull String elementName, @NotNull String value)
void
setOrAdd(@NotNull org.dom4j.Element element)
void
setOrAdd(@NotNull org.dom4j.Element parent, @NotNull String elementName, @NotNull String value)
void
setOrAdd(@NotNull org.dom4j.Element parent, @NotNull org.dom4j.Element element)
void
update(org.dom4j.Element element)
-
-
-
Method Detail
-
getDocument
protected abstract org.dom4j.Document getDocument()
-
save
public abstract void save() throws IOException
- Throws:
IOException
-
setOrAdd
public void setOrAdd(@NotNull @NotNull String elementName, @NotNull @NotNull String value)
-
setOrAdd
public void setOrAdd(@NotNull @NotNull org.dom4j.Element parent, @NotNull @NotNull String elementName, @NotNull @NotNull String value)
-
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
@Nullable public @Nullable org.dom4j.Element getElement(@NotNull @NotNull String xpathExpression)
-
getElement
@Nullable public @Nullable org.dom4j.Element getElement(@NotNull @NotNull org.dom4j.Element parent, @NotNull @NotNull String xpathExpression)
-
asElement
public static org.dom4j.Element asElement(Map<String,String> artifactHandlerConfiguration, String name)
-
saveNode
public static void saveNode(org.dom4j.Node node, File file) throws IOException
Save node contents to a file.- Parameters:
node
- element to be persistedfile
- destination file- Throws:
IOException
-
appendComment
public static void appendComment(String comment, File file) throws IOException
Appends commend to file- Parameters:
comment
- comment text, without comment marksfile
- destination file- Throws:
IOException
-
getElementText
@Nullable public @Nullable String getElementText(@NotNull @NotNull org.dom4j.Element parent, @NotNull @NotNull String elementName)
-
closeQuietly
protected static void closeQuietly(org.dom4j.io.XMLWriter writer)
-
-