Package com.cedarsoftware.util.io
Class Writers.UUIDWriter
- java.lang.Object
-
- com.cedarsoftware.util.io.Writers.UUIDWriter
-
- All Implemented Interfaces:
JsonWriter.JsonClassWriter,JsonWriter.JsonClassWriterBase
- Enclosing class:
- Writers
public static class Writers.UUIDWriter extends Object implements JsonWriter.JsonClassWriter
-
-
Constructor Summary
Constructors Constructor Description UUIDWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasPrimitiveForm()voidwrite(Object obj, boolean showType, Writer output)To preserve backward compatibility with previous serialized format the internal fields must be stored as longsvoidwritePrimitiveForm(Object o, Writer output)We can use the String representation for easier handling, but this may break backwards compatibility if an earlier library version is used
-
-
-
Method Detail
-
write
public void write(Object obj, boolean showType, Writer output) throws IOException
To preserve backward compatibility with previous serialized format the internal fields must be stored as longs- Specified by:
writein 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.- Throws:
IOException- if thrown by the writer. Will be caught at a higher level and wrapped in JsonIoException.
-
hasPrimitiveForm
public boolean hasPrimitiveForm()
- Specified by:
hasPrimitiveFormin interfaceJsonWriter.JsonClassWriter- Returns:
- boolean true if the class being written has a primitive (non-object) form.
-
writePrimitiveForm
public void writePrimitiveForm(Object o, Writer output) throws IOException
We can use the String representation for easier handling, but this may break backwards compatibility if an earlier library version is used- Specified by:
writePrimitiveFormin interfaceJsonWriter.JsonClassWriter- Parameters:
o- Object to be writtenoutput- 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.
-
-