Skip to content

Class RecordReader<R extends Record>

Javadoc 27 generates this reference during each site build from the exported packages and the annotation processor. The Java guide shows the API in use.

java.lang.Object
dev.gecode.iris.RecordReader<R>
Type Parameters:
R - the record type
public final class RecordReader<R extends Record> extends Object
Reads data into records of type R. Spec.reader(Class, MethodHandles.Lookup) makes one and checks the record's components against the entries of the reader spec, so a read can fail only as Spec.read(byte[]) does.

A reader is immutable, so threads can share it.

  • Method Details

    • read

      public R read(byte[] input)
      Reads an input without an origin or parameters.
      Parameters:
      input - the bytes of the input
      Returns:
      the record of the data read
      Throws:
      IrisException - for the first error
    • read

      public R read(byte[] input, String origin)
      Reads an input without parameters.
      Parameters:
      input - the bytes of the input
      origin - the name of the input in errors
      Returns:
      the record of the data read
      Throws:
      IrisException - for the first error
    • read

      public R read(byte[] input, String origin, Params params)
      Reads an input.
      Parameters:
      input - the bytes of the input
      origin - the name of the input in errors
      params - the parameters
      Returns:
      the record of the data read
      Throws:
      IrisException - for the first error
    • read

      public R read(String input)
      Reads an input without an origin or parameters.
      Parameters:
      input - the text of the input
      Returns:
      the record of the data read
      Throws:
      IrisException - for the first error
      IllegalArgumentException - if the text has an unpaired surrogate, which has no UTF-8 form
    • read

      public R read(String input, String origin)
      Reads an input without parameters.
      Parameters:
      input - the text of the input
      origin - the name of the input in errors
      Returns:
      the record of the data read
      Throws:
      IrisException - for the first error
      IllegalArgumentException - if the text has an unpaired surrogate, which has no UTF-8 form
    • read

      public R read(String input, String origin, Params params)
      Reads an input.
      Parameters:
      input - the text of the input
      origin - the name of the input in errors
      params - the parameters
      Returns:
      the record of the data read
      Throws:
      IrisException - for the first error
      IllegalArgumentException - if the text has an unpaired surrogate, which has no UTF-8 form
    • read

      public R read(Path input)
      Reads a file without parameters. Its path is the origin of the input.
      Parameters:
      input - the file
      Returns:
      the record of the data read
      Throws:
      IrisException - for the first error
      UncheckedIOException - if the file cannot be read
    • read

      public R read(Path input, Params params)
      Reads a file. Its path is the origin of the input.
      Parameters:
      input - the file
      params - the parameters
      Returns:
      the record of the data read
      Throws:
      IrisException - for the first error
      UncheckedIOException - if the file cannot be read