Class ObjectToXmlExtensions

java.lang.Object
io.github.astrapi69.xml.jackson.ObjectToXmlExtensions

public final class ObjectToXmlExtensions extends Object
The class ObjectToXmlExtensions provides methods for convert java objects to xml string objects
  • 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

      public static <T> void toXml(@NonNull T object, @NonNull @NonNull File file)
      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 xml
      file - the file object