Class JcsWriter

All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class JcsWriter extends JsonWriter<JcsWriter>
JSON writer for JCS (RFC 8785) canonical output.

Extends JsonWriter with ECMAScript-compatible number serialization and JCS string escaping (control characters, lone surrogate validation).

See Also:
  • Constructor Details

    • JcsWriter

      protected JcsWriter(Writer out, boolean useWhitespace, int maxIndent, boolean escapeSolidus, char quoteChar, boolean simpleAttrs, boolean trimStrings, UriResolver uriResolver)
      Constructor.
      Parameters:
      out - The writer being wrapped.
      useWhitespace - If true, tabs and spaces will be used in output.
      maxIndent - The maximum indentation level.
      escapeSolidus - If true, forward slashes should be escaped in the output.
      quoteChar - The quote character to use (always '"' for JCS).
      simpleAttrs - If true, JSON attributes will only be quoted when necessary.
      trimStrings - If true, strings will be trimmed before being serialized.
      uriResolver - The URI resolver for resolving URIs to absolute or root-relative form.
  • Method Details