Package net.mtrop.doom.map.udmf
Class UDMFReader
java.lang.Object
net.mtrop.doom.map.udmf.UDMFReader
A method for reading UDMF data, element by element, in a push-oriented way,
pushing events to a listener. Compare this to
UDMFScanner
, which is pull-oriented.- Author:
- Matthew Tropiano
-
Method Summary
Modifier and TypeMethodDescriptionstatic UDMFTable
readData
(InputStream in) Reads UDMF-formatted data into a UDMFTable from anInputStream
.static void
readData
(InputStream in, UDMFParserListener listener) Reads UDMF-formatted data into a UDMFTable from anInputStream
.static UDMFTable
Reads UDMF-formatted data into a UDMFTable from aReader
.static void
readData
(Reader reader, UDMFParserListener listener) Reads UDMF-formatted data into a UDMFTable from aReader
.static UDMFTable
Reads UDMF-formatted data into a UDMFTable from a String.static void
readData
(String data, UDMFParserListener listener) Reads UDMF-formatted data into a UDMFTable from a String.
-
Method Details
-
readData
Reads UDMF-formatted data into a UDMFTable from anInputStream
. This will read until the end of the stream is reached. Does not close the InputStream at the end of the read.- Parameters:
in
- the InputStream to read from.- Returns:
- a UDMFTable containing the structures.
- Throws:
UDMFParseException
- if a parsing error occurs.IOException
- if the data can't be read.
-
readData
Reads UDMF-formatted data into a UDMFTable from a String. This will read until the end of the stream is reached.- Parameters:
data
- the String to read from.- Returns:
- a UDMFTable containing the structures.
- Throws:
UDMFParseException
- if a parsing error occurs.IOException
- if the data can't be read.
-
readData
Reads UDMF-formatted data into a UDMFTable from aReader
. This will read until the end of the stream is reached. Does not close the Reader at the end of the read.- Parameters:
reader
- the reader to read from.- Returns:
- a UDMFTable containing the parsed structures.
- Throws:
UDMFParseException
- if a parsing error occurs.IOException
- if the data can't be read.
-
readData
Reads UDMF-formatted data into a UDMFTable from anInputStream
. This will read until the end of the stream is reached. Does not close the InputStream at the end of the read.- Parameters:
in
- the InputStream to read from.listener
- the listener to use for listening to parsed structure events.- Throws:
IOException
- if the data can't be read.
-
readData
Reads UDMF-formatted data into a UDMFTable from a String. This will read until the end of the stream is reached.- Parameters:
data
- the String to read from.listener
- the listener to use for listening to parsed structure events.- Throws:
IOException
- if the data can't be read.
-
readData
Reads UDMF-formatted data into a UDMFTable from aReader
. This will read until the end of the stream is reached. Does not close the InputStream at the end of the read.- Parameters:
reader
- the reader to read from.listener
- the listener to use for listening to parsed structure events.- Throws:
IOException
- if the data can't be read.
-