Package net.mtrop.doom.map.udmf
Class UDMFWriter
java.lang.Object
net.mtrop.doom.map.udmf.UDMFWriter
Writes UDMF data.
- Author:
- Matthew Tropiano
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
writeField
(String fieldName, Object value, Writer writer) Writes the fields out to aWriter
.static void
writeField
(String fieldName, Object value, Writer writer, String lineprefix) Writes the fields out to aWriter
.static void
writeFields
(UDMFObject object, Writer writer) Writes the fields out to aWriter
.static void
writeFields
(UDMFObject object, Writer writer, String lineprefix) Writes the fields out to aWriter
.static void
writeObject
(UDMFObject object, Writer writer, String type) Writes UDMF-formatted data into aWriter
.static void
writeObject
(UDMFObject object, Writer writer, String type, Integer count) Writes UDMF-formatted data into aWriter
.static void
writeTable
(UDMFTable table, OutputStream out, Charset charset) Writes UDMF-formatted data into anOutputStream
.static void
writeTable
(UDMFTable table, Writer writer) Writes UDMF-formatted data into aWriter
.
-
Method Details
-
writeTable
public static void writeTable(UDMFTable table, OutputStream out, Charset charset) throws IOException Writes UDMF-formatted data into anOutputStream
. 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
Writes UDMF-formatted data into aWriter
.- Parameters:
table
- the table to write.writer
- the Writer to write to.- Throws:
IOException
- if the output stream cannot be written to.
-
writeObject
Writes UDMF-formatted data into aWriter
.- 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 aWriter
.- 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
Writes the fields out to aWriter
.- 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 aWriter
.- 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
Writes the fields out to aWriter
.- 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 aWriter
.- 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.
-