Class AbstractStringAwareBufProcessor

java.lang.Object
com.couchbase.client.core.endpoint.util.AbstractStringAwareBufProcessor
Direct Known Subclasses:
ClosingPositionBufProcessor, SplitPositionBufProcessor

public abstract class AbstractStringAwareBufProcessor
extends Object
Base class for ByteBufProcessor that need to take JSON string escaping into account, through the isEscaped(byte) method.
Since:
1.3
Author:
Simon Baslé
  • Constructor Details

    • AbstractStringAwareBufProcessor

      public AbstractStringAwareBufProcessor()
  • Method Details

    • isEscaped

      protected boolean isEscaped​(byte nextByte)
      Detects opening and closing of JSON strings and keep track of it in order to mark characters in the string (delimiter quotes included) as escaped. Quotes escaped by a \ are correctly detected and do not mark a closing of a JSON string.
      Parameters:
      nextByte - the next byte to inspect.
      Returns:
      true if the byte should be ignored as part of a JSON string, false otherwise.