Class XmlObjectEncoder

    • Constructor Detail

      • XmlObjectEncoder

        public XmlObjectEncoder​(StringBuilder builder)
    • Method Detail

      • writeBooleanField

        public void writeBooleanField​(String fieldName,
                                      boolean v)
        Description copied from interface: ObjectEncoder
        Writes a boolean.
        Specified by:
        writeBooleanField in interface ObjectEncoder
        Parameters:
        fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
        v - The value to serialize
      • writeByteArrayContents

        public void writeByteArrayContents​(byte[] v)
        Description copied from interface: ObjectEncoder
        Special case for byte [] that uses base64 encoding for XML
        Specified by:
        writeByteArrayContents in interface ObjectEncoder
      • writeClassField

        public void writeClassField​(String name,
                                    Class<?> v)
        Description copied from interface: ObjectEncoder
        Writes a Class.
        Specified by:
        writeClassField in interface ObjectEncoder
        Parameters:
        name - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
        v - The value to serialize
      • writeDoubleField

        public void writeDoubleField​(String fieldName,
                                     double v)
        Description copied from interface: ObjectEncoder
        Writes a double.
        Specified by:
        writeDoubleField in interface ObjectEncoder
        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

        public void writeFloatField​(String fieldName,
                                    float v)
        Description copied from interface: ObjectEncoder
        Writes a float.
        Specified by:
        writeFloatField in interface ObjectEncoder
        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

        public void writeIntField​(String fieldName,
                                  int v)
        Description copied from interface: ObjectEncoder
        Writes an int.
        Specified by:
        writeIntField in interface ObjectEncoder
        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

        public void writeLongField​(String fieldName,
                                   long v)
        Description copied from interface: ObjectEncoder
        Writes a long.
        Specified by:
        writeLongField in interface ObjectEncoder
        Parameters:
        fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
        v - The value to serialize
      • writeObjectField

        public void writeObjectField​(String fieldName,
                                     Object object,
                                     boolean inline)
        Description copied from interface: ObjectEncoder
        Writes an object using the appropriate serializer for that object
        Specified by:
        writeObjectField in interface ObjectEncoder
        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.
      • writeStringField

        public void writeStringField​(String fieldName,
                                     String str)
        Description copied from interface: ObjectEncoder
        Writes a String.
        Specified by:
        writeStringField in interface ObjectEncoder
        Parameters:
        fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
        str - The value to serialize