diff options
author | Clyhtsuriva <61652557+clyhtsuriva@users.noreply.github.com> | 2021-06-27 11:02:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-27 11:02:03 +0000 |
commit | e13eea333d7af2786dbbbb5ed60cea4593d5ee12 (patch) | |
tree | d87270f2e9cee0586a3c7b49033cefaca0c107d0 /target/site/jacoco/musichub.util/XMLHandler.java.html | |
parent | 18359e9e2892a332f283476bc3ae887308f51cec (diff) | |
parent | 9a234079437a1532072ed5f0bce0203922719b0f (diff) |
Merge pull request #10 from Said-Belhadj/feature/STZ-0012
Feature/stz 0012
Diffstat (limited to 'target/site/jacoco/musichub.util/XMLHandler.java.html')
-rw-r--r-- | target/site/jacoco/musichub.util/XMLHandler.java.html | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/target/site/jacoco/musichub.util/XMLHandler.java.html b/target/site/jacoco/musichub.util/XMLHandler.java.html index b8ee27a..7d6e751 100644 --- a/target/site/jacoco/musichub.util/XMLHandler.java.html +++ b/target/site/jacoco/musichub.util/XMLHandler.java.html @@ -23,51 +23,51 @@ public class XMLHandler { DocumentBuilderFactory documentFactory; DocumentBuilder documentBuilder; -<span class="nc" id="L26"> public XMLHandler() {</span> +<span class="fc" id="L26"> public XMLHandler() {</span> try { -<span class="nc" id="L28"> transformerFactory = TransformerFactory.newInstance();</span> -<span class="nc" id="L29"> transformer = transformerFactory.newTransformer();</span> -<span class="nc" id="L30"> documentFactory = DocumentBuilderFactory.newInstance();</span> -<span class="nc" id="L31"> documentBuilder = documentFactory.newDocumentBuilder();</span> +<span class="fc" id="L28"> transformerFactory = TransformerFactory.newInstance();</span> +<span class="fc" id="L29"> transformer = transformerFactory.newTransformer();</span> +<span class="fc" id="L30"> documentFactory = DocumentBuilderFactory.newInstance();</span> +<span class="fc" id="L31"> documentBuilder = documentFactory.newDocumentBuilder();</span> <span class="nc" id="L32"> } catch (TransformerException | ParserConfigurationException tfe) {</span> <span class="nc" id="L33"> tfe.printStackTrace();</span> -<span class="nc" id="L34"> }</span> -<span class="nc" id="L35"> }</span> +<span class="fc" id="L34"> }</span> +<span class="fc" id="L35"> }</span> public void createXMLFile(Document document, String filePath) { try { // create the xml file //transform the DOM Object to an XML File -<span class="nc" id="L41"> DOMSource domSource = new DOMSource(document);</span> -<span class="nc" id="L42"> StreamResult streamResult = new StreamResult(new File(filePath));</span> +<span class="fc" id="L41"> DOMSource domSource = new DOMSource(document);</span> +<span class="fc" id="L42"> StreamResult streamResult = new StreamResult(new File(filePath));</span> // If you use // StreamResult result = new StreamResult(System.out); // the output will be pushed to the standard output ... // You can use that for debugging -<span class="nc" id="L49"> transformer.transform(domSource, streamResult);</span> +<span class="fc" id="L49"> transformer.transform(domSource, streamResult);</span> <span class="nc" id="L51"> } catch (TransformerException tfe) {</span> <span class="nc" id="L52"> tfe.printStackTrace();</span> -<span class="nc" id="L53"> }</span> -<span class="nc" id="L54"> }</span> +<span class="fc" id="L53"> }</span> +<span class="fc" id="L54"> }</span> public Document createXMLDocument() { -<span class="nc" id="L57"> return documentBuilder.newDocument();</span> +<span class="fc" id="L57"> return documentBuilder.newDocument();</span> } public NodeList parseXMLFile(String filePath) { -<span class="nc" id="L61"> NodeList elementNodes = null;</span> +<span class="fc" id="L61"> NodeList elementNodes = null;</span> try { -<span class="nc" id="L63"> Document document = documentBuilder.parse(new File(filePath));</span> -<span class="nc" id="L64"> Element root = document.getDocumentElement();</span> +<span class="fc" id="L63"> Document document = documentBuilder.parse(new File(filePath));</span> +<span class="fc" id="L64"> Element root = document.getDocumentElement();</span> -<span class="nc" id="L66"> elementNodes = root.getChildNodes();</span> -<span class="nc" id="L67"> } catch (SAXException | IOException e) {</span> -<span class="nc" id="L68"> e.printStackTrace();</span> -<span class="nc" id="L69"> }</span> -<span class="nc" id="L70"> return elementNodes;</span> +<span class="fc" id="L66"> elementNodes = root.getChildNodes();</span> +<span class="fc" id="L67"> } catch (SAXException | IOException e) {</span> +<span class="fc" id="L68"> e.printStackTrace();</span> +<span class="fc" id="L69"> }</span> +<span class="fc" id="L70"> return elementNodes;</span> } |