Class Writers.PrimitiveUtf8StringWriter

java.lang.Object
com.cedarsoftware.io.Writers.PrimitiveTypeWriter
com.cedarsoftware.io.Writers.PrimitiveUtf8StringWriter
All Implemented Interfaces:
JsonClassWriter
Direct Known Subclasses:
Writers.ClassWriter, Writers.EnumsAsStringWriter, Writers.JsonStringWriter, Writers.TimeZoneWriter, ZoneIdWriter
Enclosing class:
Writers

public static class Writers.PrimitiveUtf8StringWriter extends Writers.PrimitiveTypeWriter
Used as a template to write out primitive String types. Uses default key of "value" and encodes the string.
  • Constructor Details

    • PrimitiveUtf8StringWriter

      public PrimitiveUtf8StringWriter()
  • Method Details

    • extractString

      public String extractString(Object o)
    • writePrimitiveForm

      public void writePrimitiveForm(Object o, Writer output, WriterContext writerContext) throws IOException
      Description copied from interface: JsonClassWriter
      Write the object in its primitive JSON form (without surrounding braces). Only called if JsonClassWriter.hasPrimitiveForm(WriterContext) returns true.
      Parameters:
      o - Object to be written
      output - Writer destination where the JSON is written
      writerContext - WriterContext providing access to WriteOptions and writing tools
      Throws:
      IOException - if an I/O error occurs during writing