Package com.cedarsoftware.util.io
Class Writers.UUIDWriter
java.lang.Object
com.cedarsoftware.util.io.Writers.UUIDWriter
- All Implemented Interfaces:
JsonWriter.JsonClassWriter
- Enclosing class:
- Writers
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
write
(Object obj, boolean showType, Writer output, WriterContext context) To preserve backward compatibility with previous serialized format the internal fields must be stored as longsvoid
writePrimitiveForm
(Object o, Writer writer) We can use the String representation for easier handling, but this may break backwards compatibility if an earlier library version is usedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.cedarsoftware.util.io.JsonWriter.JsonClassWriter
hasPrimitiveForm, write, writePrimitiveForm
-
Constructor Details
-
UUIDWriter
public UUIDWriter()
-
-
Method Details
-
write
public void write(Object obj, boolean showType, Writer output, WriterContext context) throws IOException To preserve backward compatibility with previous serialized format the internal fields must be stored as longs- Specified by:
write
in interfaceJsonWriter.JsonClassWriter
- Parameters:
obj
- Object to be written in JSON format.showType
- boolean indicating whether to show @type.output
- Writer destination to where the actual JSON is written.context
- WriterContext to get writeOptions and other write access- Throws:
IOException
- if thrown by the writer. Will be caught at a higher level and wrapped in JsonIoException.
-
hasPrimitiveForm
public boolean hasPrimitiveForm()- Specified by:
hasPrimitiveForm
in interfaceJsonWriter.JsonClassWriter
- Returns:
- boolean true if the class being written has a primitive (non-object) form. Default is false since most custom writers will not have a primitive form.
-
writePrimitiveForm
We can use the String representation for easier handling, but this may break backwards compatibility if an earlier library version is used- Specified by:
writePrimitiveForm
in interfaceJsonWriter.JsonClassWriter
- Parameters:
o
- Object to be writtenwriter
- Writer destination to where the actual JSON is written.- Throws:
IOException
- if thrown by the writer. Will be caught at a higher level and wrapped in JsonIoException.
-