Package dev.voidframework.core.helper
Class Xml
java.lang.Object
dev.voidframework.core.helper.Xml
Helper to handle XML document.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <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.
-
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:
xmlByteArray- XML document as bytes array to convertoutputClassType- 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
-