Package dev.voidframework.core.utils
Class XmlUtils
java.lang.Object
dev.voidframework.core.utils.XmlUtils
Utility to handle XML document.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TfromXml(byte[] xmlByteArray, com.fasterxml.jackson.databind.JavaType outputJavaType) Converts a XML document into to a Java object.static <T> TConverts a XML document into to a Java object.static <T> TfromXml(InputStream inputStreamXml, com.fasterxml.jackson.databind.JavaType outputJavaType) Converts a XML document into to a Java object.static <T> TfromXml(InputStream inputStreamXml, Class<T> outputClassType) Converts a XML document into to a Java object.static <T> TConverts a XML document into to a Java object.static <T> TConverts a XML document into to a Java object.static StringConverts an object to XML document.static StringConverts an XML to string.static DocumenttoXml(byte[] data) Converts a byte array to an XML document.static DocumenttoXml(InputStream inputStreamXml) Converts aInputStreamto an XML document.
-
Method Details
-
toString
Converts an XML to string.- Parameters:
xml- The XML to convert.- Returns:
- The string representation.
-
toString
Converts an object to XML document.- Parameters:
obj- Object to convert in YAML- Returns:
- The string representation
-
fromXml
Converts a XML document into to a Java object.- Type Parameters:
T- The type of the Java object- Parameters:
xml- XML document to convertoutputClassType- Expected Java object type- Returns:
- The Java object
-
fromXml
Converts a XML document into to a Java object.- Type Parameters:
T- The type of the Java object- Parameters:
xml- XML document to convertoutputJavaType- Expected Java object type- Returns:
- The Java object
-
fromXml
Converts a XML document into to a Java object.- Type Parameters:
T- The type of the Java object- Parameters:
xmlByteArray- XML document as bytes array to convertoutputClassType- Expected Java object type- Returns:
- The Java object
-
fromXml
Converts a XML document into to a Java object.- Type Parameters:
T- The type of the Java object- Parameters:
inputStreamXml-InputStreamcontaining a XML document to convertoutputClassType- Expected Java object type- Returns:
- The Java object
-
fromXml
public static <T> T fromXml(byte[] xmlByteArray, com.fasterxml.jackson.databind.JavaType outputJavaType) Converts a XML document into to a Java object.- Type Parameters:
T- The type of the Java object- Parameters:
xmlByteArray- XML document as bytes array to convertoutputJavaType- Expected Java object type- Returns:
- The Java object
-
fromXml
public static <T> T fromXml(InputStream inputStreamXml, com.fasterxml.jackson.databind.JavaType outputJavaType) Converts a XML document into to a Java object.- Type Parameters:
T- The type of the Java object- Parameters:
inputStreamXml-InputStreamcontaining a XML document to convertoutputJavaType- Expected Java object type- Returns:
- The Java object
-
toXml
Converts a byte array to an XML document.- Parameters:
data- data to convert in XML- Returns:
- The XML document
-
toXml
Converts aInputStreamto an XML document.- Parameters:
inputStreamXml-InputStreamcontaining data to convert in XML- Returns:
- The XML document
-