@Override
    public void onSerialize(Serializer target) throws SerializationException {
        if (target instanceof DocumentWriter) {
            ((DocumentWriter)target).write(this);
        } else {
            target.put(null, id.toString());
        }
    }
Creates a document id based on a serialized document id URI string.

The document id string is not allowed to contain 0x0 byte characters.
Otherwise all characters are allowed to ensure that document ids
already stored can be de-serialized.
document/src/main/java/com/yahoo/document/DocumentId.java