Class MessageDecodeOptions

java.lang.Object
org.apache.qpid.proton.message.MessageDecodeOptions

public final class MessageDecodeOptions extends Object
Configuration options that can be passed to the Message decode APIs to govern certain behaviours of the AMQP decoder.
  • Constructor Summary

    Constructors
    Constructor
    Description
    New decode options with default values.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the maximum decode depth allowed before error when decoding Maps, Lists, Arrays, and certain related DescribedTypes from an encoded payload.
    int
    Gets the configured maximum number of elements that can be decoded from an array encoded with the zero-width elements (ulong0, uint0, list0, boolean-true, boolean-false, null).
    setMaxDecodeDepth(int maxDecodeDepth)
    Configures the maximum decode depth allowed before error when decoding Maps, Lists, Arrays, and certain related DescribedTypes from an encoded payload.
    setZeroWidthArrayElementLimit(int zeroWidthElementLimit)
    Configures the maximum number of array elements allowed while decoding arrays of zero-width elements (ulong0, uint0, list0, boolean-true, boolean-false, null) before a decode exception.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MessageDecodeOptions

      public MessageDecodeOptions()
      New decode options with default values.
  • Method Details

    • getZeroWidthArrayElementLimit

      public int getZeroWidthArrayElementLimit()
      Gets the configured maximum number of elements that can be decoded from an array encoded with the zero-width elements (ulong0, uint0, list0, boolean-true, boolean-false, null).
      Returns:
      the max number of zero-width array elements allowed.
    • setZeroWidthArrayElementLimit

      public MessageDecodeOptions setZeroWidthArrayElementLimit(int zeroWidthElementLimit)
      Configures the maximum number of array elements allowed while decoding arrays of zero-width elements (ulong0, uint0, list0, boolean-true, boolean-false, null) before a decode exception. Default is 0, meaning only the empty array is permitted.
      Parameters:
      zeroWidthElementLimit - The configured max zero-width elements allowed.
      Returns:
      this MessageDecodeOptions instance.
    • getMaxDecodeDepth

      public int getMaxDecodeDepth()
      Returns the maximum decode depth allowed before error when decoding Maps, Lists, Arrays, and certain related DescribedTypes from an encoded payload.
      Returns:
      the maximum depth limit before error for Maps, Lists, Arrays and related DescribedTypes.
    • setMaxDecodeDepth

      public MessageDecodeOptions setMaxDecodeDepth(int maxDecodeDepth)
      Configures the maximum decode depth allowed before error when decoding Maps, Lists, Arrays, and certain related DescribedTypes from an encoded payload. Default is 32.
      Parameters:
      maxDecodeDepth - The configured max decode depth allowed.
      Returns:
      this MessageDecodeOptions instance.