SerializationStreamWriter objectWriter = getSerializationStreamFactory()
.createStreamWriter();
// Serialize the object
if (this.object instanceof String) {
objectWriter.writeString((String) this.object);
} else {
objectWriter.writeObject(this.object);
}
setText(objectWriter.toString());