Interface DtoReader

  • All Known Implementing Classes:
    JsonReader

    public interface DtoReader
    An object useful for reading DTO class instances from sources representing their contents with a specific encoding.
    • Method Detail

      • readOne

        <T extends DtoReadable> T readOne​(java.lang.Class<T> class_,
                                          BinaryReader source)
                                   throws DtoReadException
        Reads one encoded value from source.
        Parameters:
        class_ - Class of value to read.
        source - Source from which the desired value is to be read.
        Returns:
        Decoded value.
        Throws:
        DtoReadException - If reading from source fails.
        java.lang.NullPointerException - If class_ or source is null.
        java.lang.UnsupportedOperationException - If the DTO interface type of class_ does not support the encoding of this reader.
      • readMany

        <T extends DtoReadable> java.util.List<T> readMany​(java.lang.Class<T> class_,
                                                           BinaryReader source)
                                                    throws DtoReadException
        Reads a list of encoded values from source.
        Parameters:
        class_ - Class of values to read.
        source - Source from which the desired values are to be read.
        Returns:
        Decoded values.
        Throws:
        DtoReadException - If reading from source fails.
        java.lang.NullPointerException - If class_ or source is null.
        java.lang.UnsupportedOperationException - If the DTO interface type of class_ does not support the encoding of this reader.