Class UDMFReader

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

public final class UDMFReader extends Object
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 Details

    • readData

      public static UDMFTable readData(InputStream in) throws IOException
      Reads UDMF-formatted data into a UDMFTable from an InputStream. 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

      public static UDMFTable readData(String data) throws IOException
      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

      public static UDMFTable readData(Reader reader) throws IOException
      Reads UDMF-formatted data into a UDMFTable from a Reader. 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

      public static void readData(InputStream in, UDMFParserListener listener) throws IOException
      Reads UDMF-formatted data into a UDMFTable from an InputStream. 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

      public static void readData(String data, UDMFParserListener listener) throws IOException
      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

      public static void readData(Reader reader, UDMFParserListener listener) throws IOException
      Reads UDMF-formatted data into a UDMFTable from a Reader. 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.