Class Writers.CharacterWriter

java.lang.Object
com.cedarsoftware.io.Writers.PrimitiveTypeWriter
com.cedarsoftware.io.Writers.CharacterWriter
All Implemented Interfaces:
JsonClassWriter
Enclosing class:
Writers

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

    • CharacterWriter

      public CharacterWriter()
  • Method Details

    • writePrimitiveForm

      public void writePrimitiveForm(Object o, Writer output, WriterContext context) 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
      context - WriterContext providing access to WriteOptions and writing tools
      Throws:
      IOException - if an I/O error occurs during writing