Class AbstractSharedGraphNode

    • Field Detail

      • _listener

        protected Listener _listener
    • Constructor Detail

      • AbstractSharedGraphNode

        public AbstractSharedGraphNode()
    • Method Detail

      • id

        public final int id()
        The ID of this node in it's default Scope.
      • initId

        protected void initId​(int id)
        Assigns the given ID.
        See Also:
        id()
      • writeTo

        public final void writeTo​(Scope scope,
                                  JsonWriter out)
                           throws IOException
        Description copied from interface: SharedGraphNode
        Writes this node to the given writer.

        Depending on the given Scope, only a reference to this object is transmitted, if this node is already known by the Scope. Otherwise, the complete object data is transmitted.

        Specified by:
        writeTo in interface SharedGraphNode
        Parameters:
        scope - The shared graph Scope that handles object references.
        out - The writer to write to.
        Throws:
        IOException
      • writeFields

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

        public void readField​(Scope scope,
                              JsonReader in,
                              String field)
                       throws IOException
        Description copied from interface: SharedGraphNode
        Reads the given field from the given input.
        Specified by:
        readField in interface SharedGraphNode
        Parameters:
        scope - The shared graph Scope that handles object references.
        in - The reader to take the value from.
        field - The name of the field whose value should be read.
        Throws:
        IOException
      • writeElement

        public void writeElement​(Scope scope,
                                 JsonWriter out,
                                 String field,
                                 Object element)
                          throws IOException
        Description copied from interface: SharedGraphNode
        Writes the given element value that is compatible with the repeated field with the given name to the given output.
        Specified by:
        writeElement in interface SharedGraphNode
        Parameters:
        scope - The shared graph Scope that handles object references.
        out - The writer to write to.
        field - The name of the field whose element should be written.
        element - The element value of the given field.
        Throws:
        IOException
      • readElement

        public Object readElement​(Scope scope,
                                  JsonReader in,
                                  String field)
                           throws IOException
        Description copied from interface: SharedGraphNode
        Read an element of the repeated field with the given name.
        Specified by:
        readElement in interface SharedGraphNode
        Parameters:
        scope - The shared graph Scope that handles object references.
        in - The reader to take the value from.
        field - The repeated field where an element value should be read for.
        Returns:
        The read element value.
        Throws:
        IOException
      • writeFieldValue

        public void writeFieldValue​(Scope scope,
                                    JsonWriter out,
                                    String field)
                             throws IOException
        Description copied from interface: SharedGraphNode
        Writes a single value that is currently assigned to the field with the given name to the given writer.
        Specified by:
        writeFieldValue in interface SharedGraphNode
        Parameters:
        scope - The shared graph Scope that handles object references.
        out - The writer to write to.
        field - The name of the field whose value should be written.
        Throws:
        IOException