Interface ObjectEncoder

All Known Implementing Classes:
BinaryObjectEncoder, XmlObjectEncoder

public interface ObjectEncoder
Interface to abstract away the difference between serializing xml and binary
  • Method Details Link icon

    • writeObjectField Link icon

      void writeObjectField(String fieldName, Object object, boolean inline)
      Writes an object using the appropriate serializer for that object
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the subelement name for xml serialization
      object - The object to serialize
      inline - Ignore for binary serialization. For xml serialization, this causes us not to have a sub-element. When inlining, polymorphic typing is not supported.
    • writeBooleanField Link icon

      void writeBooleanField(String fieldName, boolean v)
      Writes a boolean.
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
      v - The value to serialize
    • writeIntField Link icon

      void writeIntField(String fieldName, int v)
      Writes an int.
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
      v - The value to serialize
    • writeLongField Link icon

      void writeLongField(String fieldName, long v)
      Writes a long.
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
      v - The value to serialize
    • writeFloatField Link icon

      void writeFloatField(String fieldName, float v)
      Writes a float.
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
      v - The value to serialize
    • writeDoubleField Link icon

      void writeDoubleField(String fieldName, double v)
      Writes a double.
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
      v - The value to serialize
    • writeClassField Link icon

      void writeClassField(String fieldName, Class<?> v)
      Writes a Class.
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
      v - The value to serialize
    • writeStringField Link icon

      void writeStringField(String fieldName, String v)
      Writes a String.
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
      v - The value to serialize
    • writeStringContents Link icon

      void writeStringContents(String str)
      Writes the value in-line.
    • writeBooleanContents Link icon

      void writeBooleanContents(boolean v)
      Writes the value in-line.
    • writeIntContents Link icon

      void writeIntContents(int v)
      Writes the value in-line.
    • writeLongContents Link icon

      void writeLongContents(long v)
      Writes the value in-line.
    • writeFloatContents Link icon

      void writeFloatContents(float v)
      Writes the value in-line.
    • writeDoubleContents Link icon

      void writeDoubleContents(double v)
      Writes the value in-line.
    • writeByteContents Link icon

      void writeByteContents(byte v)
      Writes the value in-line.
    • writeByteArrayContents Link icon

      void writeByteArrayContents(byte[] v)
      Special case for byte [] that uses base64 encoding for XML
    • writeClassContents Link icon

      void writeClassContents(Class<?> v)
      Writes the value in-line.
    • writeObjectContents Link icon

      void writeObjectContents(Object o)
      Writes a sub-object
      Parameters:
      o - The object to write