Class XmlUtilities

java.lang.Object
de.gurkenlabs.litiengine.util.io.XmlUtilities

public final class XmlUtilities extends Object
  • Method Details

    • saveWithCustomIndentation

      public static void saveWithCustomIndentation(ByteArrayInputStream input, FileOutputStream fos, int indentation)
      Saves the XML, contained by the specified input with the custom indentation. If the input is the result of jaxb marshalling, make sure to set Marshaller.JAXB_FORMATTED_OUTPUT to false in order for this method to work properly.
      Parameters:
      input - The input stream that contains the original XML.
      fos - The output stream that is used to save the XML.
      indentation - The indentation with which the XML should be saved.
    • getContext

      public static <T> jakarta.xml.bind.JAXBContext getContext(Class<T> cls)
    • read

      public static <T> T read(Class<T> cls, URL path) throws jakarta.xml.bind.JAXBException
      Throws:
      jakarta.xml.bind.JAXBException
    • save

      public static File save(Object object, String fileName)
    • save

      public static File save(Object object, String fileName, String extension)