Class TaggedFieldSerializer.TaggedFieldSerializerConfig

    • Constructor Detail

      • TaggedFieldSerializerConfig

        public TaggedFieldSerializerConfig()
    • Method Detail

      • setReadUnknownTagData

        public void setReadUnknownTagData​(boolean readUnknownTagData)
        When false and encountering an unknown tag, an exception is thrown or, if chunked encoding is enabled, the data is skipped.

        When true, the type of each field value is written before the value. When an unknown tag is encountered, an attempt to read the data is made. This is used to skip the data and, if references are enabled, then any other values in the object graph referencing that data can still be deserialized. If reading the data fails (eg the class is unknown or has been removed) then an exception is thrown or, if chunked encoding is enabled, the data is skipped.

        In either case, if the data is skipped and references are enabled, then any references in the skipped data are not read and further deserialization receive the wrong references and fail.

        Default is false.

      • getReadUnknownTagData

        public boolean getReadUnknownTagData()
      • setChunkedEncoding

        public void setChunkedEncoding​(boolean chunked)
        When true, fields are written with chunked encoding to allow unknown field data to be skipped. This impacts performance.
        See Also:
        setReadUnknownTagData(boolean)
      • getChunkedEncoding

        public boolean getChunkedEncoding()
      • setChunkSize

        public void setChunkSize​(int chunkSize)
        The maximum size of each chunk for chunked encoding. Default is 1024.
      • getChunkSize

        public int getChunkSize()