diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java index 965d88563..1a61fd560 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java @@ -50,6 +50,7 @@ package org.hl7.fhir.utilities.xhtml; import java.io.IOException; +import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -67,7 +68,8 @@ public class XhtmlNode implements IBaseXhtml { private static final long serialVersionUID = -4362547161441436492L; - public static class Location { + public static class Location implements Serializable { + private static final long serialVersionUID = -4079302502900219721L; private int line; private int column; public Location(int line, int column) { diff --git a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/XhtmlNodeTest.java b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/XhtmlNodeTest.java index ced5e7935..646196d01 100644 --- a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/XhtmlNodeTest.java +++ b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/XhtmlNodeTest.java @@ -1,5 +1,8 @@ package org.hl7.fhir.utilities.tests; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectOutputStream; import org.hl7.fhir.utilities.xhtml.XhtmlNode; import org.junit.Test; import org.slf4j.Logger; @@ -71,4 +74,13 @@ public class XhtmlNodeTest { assertEquals("
\"Twitter@fhirabend
", output); } + @Test + public void testSerializable() throws IOException { + XhtmlNode node = new XhtmlNode(); + node.setValueAsString("
Test
"); + + ByteArrayOutputStream bout = new ByteArrayOutputStream(); + ObjectOutputStream oout = new ObjectOutputStream(bout); + oout.writeObject(node); + } } \ No newline at end of file