implement XmlProducer
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.prelude.hitfield;
+import com.yahoo.data.XmlProducer;
+
/**
* A representation of an XML chunk.
*
- * @author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a>
+ * @author Steinar Knutsen
*/
-public class XMLString {
+public class XMLString implements XmlProducer {
private final String content;
@@ -18,4 +20,14 @@ public class XMLString {
return content;
}
+ public StringBuilder writeXML(StringBuilder target) {
+ target.append(content);
+ return target;
+ }
+
+ @Override
+ public String toXML() {
+ return content;
+ }
+
}
