change package name
This commit is contained in:
parent
e7c98a9429
commit
4930100f9a
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xml;
|
||||
package com.isharkfly.xml;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xml.attribute;
|
||||
package com.isharkfly.xml.attribute;
|
||||
|
||||
import org.dom4j.*;
|
||||
import org.dom4j.io.DocumentSource;
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xml.attribute;
|
||||
package com.isharkfly.xml.attribute;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xml.attribute;
|
||||
package com.isharkfly.xml.attribute;
|
||||
|
||||
import org.joox.JOOX;
|
||||
import org.joox.Match;
|
@ -1,8 +1,8 @@
|
||||
package com.baeldung.xml.attribute.jmh;
|
||||
package com.isharkfly.xml.attribute.jmh;
|
||||
|
||||
import com.baeldung.xml.attribute.Dom4jTransformer;
|
||||
import com.baeldung.xml.attribute.JaxpTransformer;
|
||||
import com.baeldung.xml.attribute.JooxTransformer;
|
||||
import com.isharkfly.xml.attribute.Dom4jTransformer;
|
||||
import com.isharkfly.xml.attribute.JaxpTransformer;
|
||||
import com.isharkfly.xml.attribute.JooxTransformer;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.openjdk.jmh.annotations.*;
|
||||
import org.openjdk.jmh.runner.Runner;
|
@ -4,7 +4,7 @@
|
||||
* Copyright 2008 Stefan Jäger
|
||||
*
|
||||
*/
|
||||
package com.baeldung.xml.jibx;
|
||||
package com.isharkfly.xml.jibx;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xml.jibx;
|
||||
package com.isharkfly.xml.jibx;
|
||||
|
||||
public class Identity {
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Copyright 2008 Stefan Jäger
|
||||
*
|
||||
*/
|
||||
package com.baeldung.xml.jibx;
|
||||
package com.isharkfly.xml.jibx;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xml.jibx;
|
||||
package com.isharkfly.xml.jibx;
|
||||
|
||||
public class Phone {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xml.tohashmap;
|
||||
package com.isharkfly.xml.tohashmap;
|
||||
|
||||
public class Employee {
|
||||
private String id;
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xml.tohashmap;
|
||||
package com.isharkfly.xml.tohashmap;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xml.tohashmap;
|
||||
package com.isharkfly.xml.tohashmap;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xml.xml2csv;
|
||||
package com.isharkfly.xml.xml2csv;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xml.xml2pdf;
|
||||
package com.isharkfly.xml.xml2pdf;
|
||||
|
||||
import com.itextpdf.text.Document;
|
||||
import com.itextpdf.text.Paragraph;
|
@ -1,6 +1,6 @@
|
||||
package com.baeldung.xmlhtml;
|
||||
package com.isharkfly.xmlhtml;
|
||||
|
||||
import com.baeldung.xmlhtml.helpers.XMLRunner;
|
||||
import com.isharkfly.xmlhtml.helpers.XMLRunner;
|
||||
|
||||
public class Application {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xmlhtml;
|
||||
package com.isharkfly.xmlhtml;
|
||||
|
||||
public class Constants {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.baeldung.xmlhtml.freemarker;
|
||||
package com.isharkfly.xmlhtml.freemarker;
|
||||
|
||||
import com.baeldung.xmlhtml.stax.StaxTransformer;
|
||||
import com.isharkfly.xmlhtml.stax.StaxTransformer;
|
||||
import freemarker.template.Configuration;
|
||||
import freemarker.template.Template;
|
||||
import freemarker.template.TemplateException;
|
@ -1,7 +1,7 @@
|
||||
package com.baeldung.xmlhtml.helpers;
|
||||
package com.isharkfly.xmlhtml.helpers;
|
||||
|
||||
|
||||
import com.baeldung.xmlhtml.helpers.jaxb.JAXBHelper;
|
||||
import com.isharkfly.xmlhtml.helpers.jaxb.JAXBHelper;
|
||||
|
||||
public class XMLRunner {
|
||||
|
@ -1,18 +1,18 @@
|
||||
package com.baeldung.xmlhtml.helpers.jaxb;
|
||||
package com.isharkfly.xmlhtml.helpers.jaxb;
|
||||
|
||||
import com.baeldung.xmlhtml.pojo.jaxb.html.ExampleHTML;
|
||||
import com.baeldung.xmlhtml.pojo.jaxb.html.elements.Body;
|
||||
import com.baeldung.xmlhtml.pojo.jaxb.html.elements.CustomElement;
|
||||
import com.baeldung.xmlhtml.pojo.jaxb.html.elements.Meta;
|
||||
import com.baeldung.xmlhtml.pojo.jaxb.html.elements.NestedElement;
|
||||
import com.baeldung.xmlhtml.pojo.jaxb.xml.XMLExample;
|
||||
import com.isharkfly.xmlhtml.pojo.jaxb.html.ExampleHTML;
|
||||
import com.isharkfly.xmlhtml.pojo.jaxb.html.elements.Body;
|
||||
import com.isharkfly.xmlhtml.pojo.jaxb.html.elements.CustomElement;
|
||||
import com.isharkfly.xmlhtml.pojo.jaxb.html.elements.Meta;
|
||||
import com.isharkfly.xmlhtml.pojo.jaxb.html.elements.NestedElement;
|
||||
import com.isharkfly.xmlhtml.pojo.jaxb.xml.XMLExample;
|
||||
import jakarta.xml.bind.JAXBContext;
|
||||
import jakarta.xml.bind.Marshaller;
|
||||
import jakarta.xml.bind.Unmarshaller;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static com.baeldung.xmlhtml.Constants.*;
|
||||
import static com.isharkfly.xmlhtml.Constants.*;
|
||||
|
||||
public class JAXBHelper {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xmlhtml.jaxp;
|
||||
package com.isharkfly.xmlhtml.jaxp;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
@ -1,6 +1,6 @@
|
||||
package com.baeldung.xmlhtml.mustache;
|
||||
package com.isharkfly.xmlhtml.mustache;
|
||||
|
||||
import com.baeldung.xmlhtml.stax.StaxTransformer;
|
||||
import com.isharkfly.xmlhtml.stax.StaxTransformer;
|
||||
import com.github.mustachejava.DefaultMustacheFactory;
|
||||
import com.github.mustachejava.Mustache;
|
||||
import com.github.mustachejava.MustacheFactory;
|
@ -1,7 +1,7 @@
|
||||
package com.baeldung.xmlhtml.pojo.jaxb.html;
|
||||
package com.isharkfly.xmlhtml.pojo.jaxb.html;
|
||||
|
||||
import com.baeldung.xmlhtml.pojo.jaxb.html.elements.Body;
|
||||
import com.baeldung.xmlhtml.pojo.jaxb.html.elements.Meta;
|
||||
import com.isharkfly.xmlhtml.pojo.jaxb.html.elements.Body;
|
||||
import com.isharkfly.xmlhtml.pojo.jaxb.html.elements.Meta;
|
||||
import jakarta.xml.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xmlhtml.pojo.jaxb.html.elements;
|
||||
package com.isharkfly.xmlhtml.pojo.jaxb.html.elements;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xmlhtml.pojo.jaxb.html.elements;
|
||||
package com.isharkfly.xmlhtml.pojo.jaxb.html.elements;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlValue;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xmlhtml.pojo.jaxb.html.elements;
|
||||
package com.isharkfly.xmlhtml.pojo.jaxb.html.elements;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
import jakarta.xml.bind.annotation.XmlValue;
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xmlhtml.pojo.jaxb.html.elements;
|
||||
package com.isharkfly.xmlhtml.pojo.jaxb.html.elements;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.baeldung.xmlhtml.pojo.jaxb.xml;
|
||||
package com.isharkfly.xmlhtml.pojo.jaxb.xml;
|
||||
|
||||
import com.baeldung.xmlhtml.pojo.jaxb.xml.elements.Ancestor;
|
||||
import com.isharkfly.xmlhtml.pojo.jaxb.xml.elements.Ancestor;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xmlhtml.pojo.jaxb.xml.elements;
|
||||
package com.isharkfly.xmlhtml.pojo.jaxb.xml.elements;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xmlhtml.pojo.jaxb.xml.elements;
|
||||
package com.isharkfly.xmlhtml.pojo.jaxb.xml.elements;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlValue;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xmlhtml.pojo.jaxb.xml.elements;
|
||||
package com.isharkfly.xmlhtml.pojo.jaxb.xml.elements;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlValue;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xmlhtml.pojo.jaxb.xml.elements;
|
||||
package com.isharkfly.xmlhtml.pojo.jaxb.xml.elements;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xmlhtml.stax;
|
||||
package com.isharkfly.xmlhtml.stax;
|
||||
|
||||
import javax.xml.stream.*;
|
||||
import java.io.FileInputStream;
|
@ -1,24 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<binding>
|
||||
<mapping class="com.baeldung.xml.jibx.Identity" abstract="true">
|
||||
<mapping class="com.isharkfly.xml.jibx.Identity" abstract="true">
|
||||
<value name="customer-id" field="customerId" />
|
||||
</mapping>
|
||||
|
||||
<mapping name="customer" class="com.baeldung.xml.jibx.Customer">
|
||||
<mapping name="customer" class="com.isharkfly.xml.jibx.Customer">
|
||||
<structure field="person" />
|
||||
<structure name="home-phone" field="homePhone" usage="optional" />
|
||||
<structure name="office-phone" field="officePhone" usage="optional" />
|
||||
<value name="city" field="city" />
|
||||
</mapping>
|
||||
|
||||
<mapping name="person" class="com.baeldung.xml.jibx.Person"
|
||||
extends="com.baeldung.xml.jibx.Identity">
|
||||
<structure map-as="com.baeldung.xml.jibx.Identity" />
|
||||
<mapping name="person" class="com.isharkfly.xml.jibx.Person"
|
||||
extends="com.isharkfly.xml.jibx.Identity">
|
||||
<structure map-as="com.isharkfly.xml.jibx.Identity" />
|
||||
<value name="name" field="name" />
|
||||
|
||||
</mapping>
|
||||
|
||||
<mapping class="com.baeldung.xml.jibx.Phone" abstract="true">
|
||||
<mapping class="com.isharkfly.xml.jibx.Phone" abstract="true">
|
||||
<value name="number" field="number" />
|
||||
</mapping>
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.baeldung.xml;
|
||||
package com.isharkfly.xml;
|
||||
|
||||
import com.isharkfly.xml.XMLDocumentWriter;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
@ -1,5 +1,6 @@
|
||||
package com.baeldung.xml.attribute;
|
||||
package com.isharkfly.xml.attribute;
|
||||
|
||||
import com.isharkfly.xml.attribute.Dom4jTransformer;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.xml.sax.SAXException;
|
@ -1,5 +1,6 @@
|
||||
package com.baeldung.xml.attribute;
|
||||
package com.isharkfly.xml.attribute;
|
||||
|
||||
import com.isharkfly.xml.attribute.JaxpTransformer;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.SAXParseException;
|
@ -1,5 +1,6 @@
|
||||
package com.baeldung.xml.attribute;
|
||||
package com.isharkfly.xml.attribute;
|
||||
|
||||
import com.isharkfly.xml.attribute.JooxTransformer;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.SAXParseException;
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xml.invalidcharacters;
|
||||
package com.isharkfly.xml.invalidcharacters;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.InputSource;
|
@ -1,5 +1,6 @@
|
||||
package com.baeldung.xml.jibx;
|
||||
package com.isharkfly.xml.jibx;
|
||||
|
||||
import com.isharkfly.xml.jibx.Customer;
|
||||
import org.jibx.runtime.BindingDirectory;
|
||||
import org.jibx.runtime.IBindingFactory;
|
||||
import org.jibx.runtime.IUnmarshallingContext;
|
@ -1,11 +1,12 @@
|
||||
package com.baeldung.xml.tohashmap;
|
||||
package com.isharkfly.xml.tohashmap;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
||||
import com.isharkfly.xml.tohashmap.Employee;
|
||||
import com.isharkfly.xml.tohashmap.XmlToHashMap;
|
||||
import jakarta.xml.bind.JAXBException;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xml.xml2csv;
|
||||
package com.isharkfly.xml.xml2csv;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
@ -18,6 +18,7 @@ import java.util.concurrent.Executors;
|
||||
|
||||
import javax.xml.transform.TransformerException;
|
||||
|
||||
import com.isharkfly.xml.xml2csv.Xml2CsvExample;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -1,37 +1,37 @@
|
||||
package com.baeldung.xml.xml2document;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.w3c.dom.*;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class XMLStringToDocumentObjectUnitTest {
|
||||
@Test
|
||||
public void givenValidXMLString_whenParsing_thenDocumentIsCorrect() throws ParserConfigurationException {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
String xmlString = "<root><element>XML Parsing Example</element></root>";
|
||||
InputSource is = new InputSource(new StringReader(xmlString));
|
||||
Document xmlDoc = null;
|
||||
try {
|
||||
xmlDoc = builder.parse(is);
|
||||
} catch (SAXException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
assertEquals("root", xmlDoc.getDocumentElement().getNodeName());
|
||||
assertEquals("element", xmlDoc.getDocumentElement().getElementsByTagName("element").item(0).getNodeName());
|
||||
assertEquals("XML Parsing Example", xmlDoc.getDocumentElement().getElementsByTagName("element").item(0).getTextContent());
|
||||
}
|
||||
}
|
||||
package com.isharkfly.xml.xml2document;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.w3c.dom.*;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class XMLStringToDocumentObjectUnitTest {
|
||||
@Test
|
||||
public void givenValidXMLString_whenParsing_thenDocumentIsCorrect() throws ParserConfigurationException {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
String xmlString = "<root><element>XML Parsing Example</element></root>";
|
||||
InputSource is = new InputSource(new StringReader(xmlString));
|
||||
Document xmlDoc = null;
|
||||
try {
|
||||
xmlDoc = builder.parse(is);
|
||||
} catch (SAXException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
assertEquals("root", xmlDoc.getDocumentElement().getNodeName());
|
||||
assertEquals("element", xmlDoc.getDocumentElement().getElementsByTagName("element").item(0).getNodeName());
|
||||
assertEquals("XML Parsing Example", xmlDoc.getDocumentElement().getElementsByTagName("element").item(0).getTextContent());
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.baeldung.xml.xml2pdf;
|
||||
package com.isharkfly.xml.xml2pdf;
|
||||
|
||||
import com.isharkfly.xml.xml2pdf.XmlToPdfConverter;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.xmlhtml.delhtmltags;
|
||||
package com.isharkfly.xmlhtml.delhtmltags;
|
||||
|
||||
import net.htmlparser.jericho.Renderer;
|
||||
import net.htmlparser.jericho.Segment;
|
@ -1,6 +1,7 @@
|
||||
package com.baeldung.xmlhtml.freemarker;
|
||||
package com.isharkfly.xmlhtml.freemarker;
|
||||
|
||||
import com.baeldung.xmlhtml.stax.StaxTransformer;
|
||||
import com.isharkfly.xmlhtml.freemarker.FreemarkerTransformer;
|
||||
import com.isharkfly.xmlhtml.stax.StaxTransformer;
|
||||
import freemarker.template.TemplateException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.baeldung.xmlhtml.jaxp;
|
||||
package com.isharkfly.xmlhtml.jaxp;
|
||||
|
||||
import com.isharkfly.xmlhtml.jaxp.JaxpTransformer;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.xml.sax.SAXException;
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.baeldung.xmlhtml.mustache;
|
||||
package com.isharkfly.xmlhtml.mustache;
|
||||
|
||||
import com.baeldung.xmlhtml.stax.StaxTransformer;
|
||||
import com.isharkfly.xmlhtml.mustache.MustacheTransformer;
|
||||
import com.isharkfly.xmlhtml.stax.StaxTransformer;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import javax.xml.stream.XMLStreamException;
|
@ -1,5 +1,6 @@
|
||||
package com.baeldung.xmlhtml.stax;
|
||||
package com.isharkfly.xmlhtml.stax;
|
||||
|
||||
import com.isharkfly.xmlhtml.stax.StaxTransformer;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
Loading…
x
Reference in New Issue
Block a user