Package com.cedarsoftware.io
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
Used as a template to write out primitive String types.
Uses default key of "value" and encodes the string.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidwritePrimitiveForm(Object o, Writer output, WriterContext writerContext) Write the object in its primitive JSON form (without surrounding braces).Methods inherited from class com.cedarsoftware.io.Writers.PrimitiveTypeWriter
getKey, hasPrimitiveForm, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.cedarsoftware.io.JsonClassWriter
getTypeName
-
Constructor Details
-
PrimitiveUtf8StringWriter
public PrimitiveUtf8StringWriter()
-
-
Method Details
-
extractString
-
writePrimitiveForm
public void writePrimitiveForm(Object o, Writer output, WriterContext writerContext) throws IOException Description copied from interface:JsonClassWriterWrite the object in its primitive JSON form (without surrounding braces). Only called ifJsonClassWriter.hasPrimitiveForm(WriterContext)returns true.- Parameters:
o- Object to be writtenoutput- Writer destination where the JSON is writtenwriterContext- WriterContext providing access to WriteOptions and writing tools- Throws:
IOException- if an I/O error occurs during writing
-