diff options
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/isode/stroke/serializer/payloadserializers/FullPayloadSerializerCollection.java | 2 | ||||
-rw-r--r-- | src/com/isode/stroke/serializer/payloadserializers/SubjectSerializer.java | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/com/isode/stroke/serializer/payloadserializers/FullPayloadSerializerCollection.java b/src/com/isode/stroke/serializer/payloadserializers/FullPayloadSerializerCollection.java index 9cb3646..ee8ad05 100644 --- a/src/com/isode/stroke/serializer/payloadserializers/FullPayloadSerializerCollection.java +++ b/src/com/isode/stroke/serializer/payloadserializers/FullPayloadSerializerCollection.java @@ -22,7 +22,7 @@ public class FullPayloadSerializerCollection extends PayloadSerializerCollection /*FIXME: Implement what's needed. */ //addSerializer(new IBBSerializer()); addSerializer(new BodySerializer()); - //addSerializer(new SubjectSerializer()); + addSerializer(new SubjectSerializer()); //addSerializer(new ChatStateSerializer()); //addSerializer(new PrioritySerializer()); addSerializer(new ErrorSerializer()); diff --git a/src/com/isode/stroke/serializer/payloadserializers/SubjectSerializer.java b/src/com/isode/stroke/serializer/payloadserializers/SubjectSerializer.java new file mode 100644 index 0000000..885d86c --- /dev/null +++ b/src/com/isode/stroke/serializer/payloadserializers/SubjectSerializer.java @@ -0,0 +1,22 @@ +package com.isode.stroke.serializer.payloadserializers; + +import com.isode.stroke.elements.Subject; +import com.isode.stroke.serializer.GenericPayloadSerializer; +import com.isode.stroke.serializer.xml.XMLTextNode; + +/** + * Subject to String + */ +public class SubjectSerializer extends GenericPayloadSerializer<Subject> { + + public SubjectSerializer() { + super(Subject.class); + } + + @Override + protected String serializePayload(Subject payload) { + XMLTextNode textNode = new XMLTextNode(payload.getText()); + return "<subject>"+textNode.serialize()+"</subject>"; + } + +} |