Class UonWriter

All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class UonWriter extends SerializerWriter<UonWriter>
Specialized writer for serializing UON-encoded text.
Notes:
  • This class is not intended for external use.
See Also:
  • Constructor Details

    • UonWriter

      protected UonWriter(UonSerializerSession session, Writer out, boolean useWhitespace, int maxIndent, boolean encodeChars, boolean trimStrings, boolean plainTextParams, char quoteChar, UriResolver uriResolver)
      Constructor.
      Parameters:
      session - The session that created this writer.
      out - The writer being wrapped.
      useWhitespace - If true, tabs will be used in output.
      maxIndent - The maximum indentation level.
      encodeChars - If true, special characters should be encoded.
      trimStrings - If true, strings should be trimmed before they're serialized.
      plainTextParams - If true, don't use UON notation for values.
      quoteChar - The quote character to use. If 0, defaults to '\''.
      uriResolver - The URI resolver for resolving URIs to absolute or root-relative form.
  • Method Details

    • appendObject

      public UonWriter appendObject(Object o, boolean isTopAttrName)
      Serializes the specified simple object as a UON string value.
      Parameters:
      o - The object being serialized.
      Can be null (emitted as the literal "null").
      isTopAttrName - If this is a top-level attribute name we're serializing.
      Returns:
      This object.
    • appendUri

      public UonWriter appendUri(Object uri)
      Appends a URI to the output.
      Overrides:
      appendUri in class SerializerWriter<UonWriter>
      Parameters:
      uri - The URI to append to the output.
      Returns:
      This object.
    • appendBoolean

      Appends a boolean value to the output.
      Parameters:
      o - The boolean value to append to the output.
      Returns:
      This object.
    • appendNumber

      protected UonWriter appendNumber(Object o)
      Appends a numeric value to the output.
      Parameters:
      o - The numeric value to append to the output.
      Returns:
      This object.