Class UDMFWriter

java.lang.Object
net.mtrop.doom.map.udmf.UDMFWriter

public final class UDMFWriter extends Object
Writes UDMF data.
Author:
Matthew Tropiano
  • Method Details

    • writeTable

      public static void writeTable(UDMFTable table, OutputStream out, Charset charset) throws IOException
      Writes UDMF-formatted data into an OutputStream. Does not close the OutputStream at the end of the write.
      Parameters:
      table - the table to write.
      out - the OutputStream to write to.
      charset - the
      Throws:
      IOException - if the output stream cannot be written to.
    • writeTable

      public static void writeTable(UDMFTable table, Writer writer) throws IOException
      Writes UDMF-formatted data into a Writer.
      Parameters:
      table - the table to write.
      writer - the Writer to write to.
      Throws:
      IOException - if the output stream cannot be written to.
    • writeObject

      public static void writeObject(UDMFObject object, Writer writer, String type) throws IOException
      Writes UDMF-formatted data into a Writer.
      Parameters:
      object - the object to write.
      writer - the Writer to write to.
      type - the object type.
      Throws:
      IOException - if the output stream cannot be written to.
      Since:
      2.9.1
    • writeObject

      public static void writeObject(UDMFObject object, Writer writer, String type, Integer count) throws IOException
      Writes UDMF-formatted data into a Writer.
      Parameters:
      object - the object to write.
      writer - the Writer to write to.
      type - the object type.
      count - the index of the written object (can be null - not required).
      Throws:
      IOException - if the output stream cannot be written to.
      Since:
      2.9.1, count is actually nullable.
    • writeFields

      public static void writeFields(UDMFObject object, Writer writer) throws IOException
      Writes the fields out to a Writer.
      Parameters:
      object - the object to write.
      writer - the Writer to write to.
      Throws:
      IOException - if the output stream cannot be written to.
      Since:
      2.9.1
    • writeFields

      public static void writeFields(UDMFObject object, Writer writer, String lineprefix) throws IOException
      Writes the fields out to a Writer.
      Parameters:
      object - the object to write.
      writer - the Writer to write to.
      lineprefix - a string to prepend to each line.
      Throws:
      IOException - if the output stream cannot be written to.
    • writeField

      public static void writeField(String fieldName, Object value, Writer writer) throws IOException
      Writes the fields out to a Writer.
      Parameters:
      fieldName - the field name.
      value - the field's value.
      writer - the Writer to write to.
      Throws:
      IOException - if the output stream cannot be written to.
      Since:
      2.9.1
    • writeField

      public static void writeField(String fieldName, Object value, Writer writer, String lineprefix) throws IOException
      Writes the fields out to a Writer.
      Parameters:
      fieldName - the field name.
      value - the field's value.
      writer - the Writer to write to.
      lineprefix - a string to prepend to each line.
      Throws:
      IOException - if the output stream cannot be written to.