Class AbstractXmlUpgrader

    • Constructor Detail

      • AbstractXmlUpgrader

        public AbstractXmlUpgrader()
    • Method Detail

      • getDocument

        protected abstract org.dom4j.Document getDocument()
      • 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)
      • asMap

        public static Map<String,​String> asMap​(@NotNull
                                                     @NotNull org.dom4j.Element element)
      • 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 persisted
        file - 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 marks
        file - 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)
      • logChanges

        protected static void logChanges​(String xmlSourceIdentifier,
                                         String originalContent,
                                         String newContent)