java.lang.Object
io.github.astrapi69.xml.jackson.ObjectToXmlExtensions
The class
ObjectToXmlExtensions
provides methods for convert java objects to xml string
objects-
Method Summary
-
Method Details
-
toXml
public static <T> String toXml(@NonNull T objectToXML) throws com.fasterxml.jackson.core.JsonProcessingException Creates from the given Object an xml string.- Type Parameters:
T
- the generic type of the return type- Parameters:
objectToXML
- the object to xml- Returns:
- the xml string
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
- is thrown when processing json content that are not pure I/O problems
-
toXml
Converts the given object to a xml string and write it to the given file object- Type Parameters:
T
- the generic type of the return type- Parameters:
object
- the object to convert to xmlfile
- the file object
-