Class AbstractDataObject

    • Constructor Detail

      • AbstractDataObject

        public AbstractDataObject()
    • Method Detail

      • writeContent

        public final void writeContent​(JsonWriter out)
                                throws IOException
        Writes a JSON object containing keys for all fields of this object.

        In contrast to DataObject.writeTo(JsonWriter), the resulting object contains no type information. Therefore, this method must only be called directly, if the reader knows the type of the object to read from the context. For reading the data, a per-type generated read[type-name]() method must be called.

        Parameters:
        out - The writer to write to.
        Throws:
        IOException
      • writeFields

        protected void writeFields​(JsonWriter out)
                            throws IOException
        Writes all fields of this instance to the given output.
        Parameters:
        out - The writer to write to.
        Throws:
        IOException - If writing fails.
      • readFields

        protected final void readFields​(JsonReader in)
                                 throws IOException
        Reads all fields of this instance from the given input.
        Parameters:
        in - The reader to take the input from.
        Throws:
        IOException
      • readField

        protected void readField​(JsonReader in,
                                 String field)
                          throws IOException
        Reads the given field from the given input.
        Parameters:
        in - The reader to take the value from.
        field - The name of the field whose value should be read.
        Throws:
        IOException