aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/main
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-01-27 14:07:45 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2023-01-27 14:07:45 +0100
commit75ab63c8dea02c4e8148fb7e79730d163eb6647e (patch)
treeb2557fc192f6faff27066fddb1b7692c9d06cc93 /document/src/main
parentb6e493d2eba1e35bd07de4eb380299e2d21ec1bc (diff)
Deprecate xml methods
Diffstat (limited to 'document/src/main')
-rw-r--r--document/src/main/java/com/yahoo/document/Document.java3
-rw-r--r--document/src/main/java/com/yahoo/document/PositionDataType.java1
-rw-r--r--document/src/main/java/com/yahoo/document/annotation/AnnotationReference.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/Array.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/BoolFieldValue.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/ByteFieldValue.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/DoubleFieldValue.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/FieldValue.java2
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/Float16FieldValue.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/FloatFieldValue.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/IntegerFieldValue.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/LongFieldValue.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/MapFieldValue.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/PredicateFieldValue.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/Raw.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/ReferenceFieldValue.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/StringFieldValue.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/Struct.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/TensorFieldValue.java1
-rw-r--r--document/src/main/java/com/yahoo/document/datatypes/WeightedSet.java1
-rw-r--r--document/src/main/java/com/yahoo/document/serialization/XmlDocumentWriter.java339
-rw-r--r--document/src/main/java/com/yahoo/document/serialization/XmlSerializationHelper.java2
-rw-r--r--document/src/main/java/com/yahoo/document/serialization/XmlStream.java1
23 files changed, 26 insertions, 339 deletions
diff --git a/document/src/main/java/com/yahoo/document/Document.java b/document/src/main/java/com/yahoo/document/Document.java
index 3dc628e0a90..ac789bc681d 100644
--- a/document/src/main/java/com/yahoo/document/Document.java
+++ b/document/src/main/java/com/yahoo/document/Document.java
@@ -204,6 +204,7 @@ public class Document extends StructuredFieldValue {
return "document '" + docId + "' of type '" + getDataType().getName() + "'";
}
+ @Deprecated
public String toXML(String indent) {
XmlStream xml = new XmlStream();
xml.setIndent(indent);
@@ -218,10 +219,12 @@ public class Document extends StructuredFieldValue {
* within a &lt;document&gt;&lt;/document&gt; tag.
* @return XML representation of document
*/
+ @Deprecated
public String toXml() {
return toXML(" ");
}
+ @Deprecated
public void printXml(XmlStream xml) {
XmlSerializationHelper.printDocumentXml(this, xml);
}
diff --git a/document/src/main/java/com/yahoo/document/PositionDataType.java b/document/src/main/java/com/yahoo/document/PositionDataType.java
index d4160fc58c7..c442145a74e 100644
--- a/document/src/main/java/com/yahoo/document/PositionDataType.java
+++ b/document/src/main/java/com/yahoo/document/PositionDataType.java
@@ -53,6 +53,7 @@ public final class PositionDataType {
return buf.toString();
}
+ @Deprecated
public static void renderXml(Struct pos, XmlStream target) {
target.addContent(renderAsString(pos));
}
diff --git a/document/src/main/java/com/yahoo/document/annotation/AnnotationReference.java b/document/src/main/java/com/yahoo/document/annotation/AnnotationReference.java
index cb8a7a6dd0a..924f401f8be 100644
--- a/document/src/main/java/com/yahoo/document/annotation/AnnotationReference.java
+++ b/document/src/main/java/com/yahoo/document/annotation/AnnotationReference.java
@@ -122,6 +122,7 @@ public class AnnotationReference extends FieldValue {
}
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
// TODO: Implement AnnotationReference.printXml()
}
diff --git a/document/src/main/java/com/yahoo/document/datatypes/Array.java b/document/src/main/java/com/yahoo/document/datatypes/Array.java
index dba1c0783cf..f1d1255916c 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/Array.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/Array.java
@@ -112,6 +112,7 @@ public final class Array<T extends FieldValue> extends CollectionFieldValue<T> i
}
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
XmlSerializationHelper.printArrayXml(this, xml);
}
diff --git a/document/src/main/java/com/yahoo/document/datatypes/BoolFieldValue.java b/document/src/main/java/com/yahoo/document/datatypes/BoolFieldValue.java
index 962ed6b1817..199ca199667 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/BoolFieldValue.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/BoolFieldValue.java
@@ -76,6 +76,7 @@ public class BoolFieldValue extends FieldValue {
}
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
XmlSerializationHelper.printBoolXml(this, xml);
}
diff --git a/document/src/main/java/com/yahoo/document/datatypes/ByteFieldValue.java b/document/src/main/java/com/yahoo/document/datatypes/ByteFieldValue.java
index bf010b4715d..ec455f90f06 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/ByteFieldValue.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/ByteFieldValue.java
@@ -93,6 +93,7 @@ public class ByteFieldValue extends NumericFieldValue {
}
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
XmlSerializationHelper.printByteXml(this, xml);
}
diff --git a/document/src/main/java/com/yahoo/document/datatypes/DoubleFieldValue.java b/document/src/main/java/com/yahoo/document/datatypes/DoubleFieldValue.java
index 55dfff2a954..2fbf1808a75 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/DoubleFieldValue.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/DoubleFieldValue.java
@@ -88,6 +88,7 @@ public final class DoubleFieldValue extends NumericFieldValue {
}
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
XmlSerializationHelper.printDoubleXml(this, xml);
}
diff --git a/document/src/main/java/com/yahoo/document/datatypes/FieldValue.java b/document/src/main/java/com/yahoo/document/datatypes/FieldValue.java
index 493dd964b9e..d43fed19005 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/FieldValue.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/FieldValue.java
@@ -37,6 +37,7 @@ public abstract class FieldValue extends Identifiable implements Comparable<Fiel
*
* @return XML representation of field in a &lt;value&gt; element
*/
+ @Deprecated
public String toXml() {
XmlStream xml = new XmlStream();
xml.setIndent(" ");
@@ -58,6 +59,7 @@ public abstract class FieldValue extends Identifiable implements Comparable<Fiel
serialize(DocumentSerializerFactory.create6(buf));
}
+ @Deprecated
public abstract void printXml(XmlStream xml);
public abstract void clear();
diff --git a/document/src/main/java/com/yahoo/document/datatypes/Float16FieldValue.java b/document/src/main/java/com/yahoo/document/datatypes/Float16FieldValue.java
index f9cf7419e01..06ec0d692ce 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/Float16FieldValue.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/Float16FieldValue.java
@@ -86,6 +86,7 @@ public final class Float16FieldValue extends NumericFieldValue {
}
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
XmlSerializationHelper.printShortfloatXml(this, xml);
}
diff --git a/document/src/main/java/com/yahoo/document/datatypes/FloatFieldValue.java b/document/src/main/java/com/yahoo/document/datatypes/FloatFieldValue.java
index 5fa850f69a3..ffc13dc42e8 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/FloatFieldValue.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/FloatFieldValue.java
@@ -88,6 +88,7 @@ public final class FloatFieldValue extends NumericFieldValue {
}
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
XmlSerializationHelper.printFloatXml(this, xml);
}
diff --git a/document/src/main/java/com/yahoo/document/datatypes/IntegerFieldValue.java b/document/src/main/java/com/yahoo/document/datatypes/IntegerFieldValue.java
index c02122525b1..d2c20abbb9d 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/IntegerFieldValue.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/IntegerFieldValue.java
@@ -85,6 +85,7 @@ public final class IntegerFieldValue extends NumericFieldValue {
}
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
XmlSerializationHelper.printIntegerXml(this, xml);
}
diff --git a/document/src/main/java/com/yahoo/document/datatypes/LongFieldValue.java b/document/src/main/java/com/yahoo/document/datatypes/LongFieldValue.java
index da6b91e4071..0dedfa72fc4 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/LongFieldValue.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/LongFieldValue.java
@@ -89,6 +89,7 @@ public final class LongFieldValue extends NumericFieldValue {
}
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
XmlSerializationHelper.printLongXml(this, xml);
}
diff --git a/document/src/main/java/com/yahoo/document/datatypes/MapFieldValue.java b/document/src/main/java/com/yahoo/document/datatypes/MapFieldValue.java
index a82639cae0c..01cd092bf57 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/MapFieldValue.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/MapFieldValue.java
@@ -98,6 +98,7 @@ public class MapFieldValue<K extends FieldValue, V extends FieldValue> extends C
}
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
XmlSerializationHelper.printMapXml(this, xml);
}
diff --git a/document/src/main/java/com/yahoo/document/datatypes/PredicateFieldValue.java b/document/src/main/java/com/yahoo/document/datatypes/PredicateFieldValue.java
index aba5e51f723..dc62a5f413d 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/PredicateFieldValue.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/PredicateFieldValue.java
@@ -45,6 +45,7 @@ public class PredicateFieldValue extends FieldValue {
}
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
if (predicate == null) {
return;
diff --git a/document/src/main/java/com/yahoo/document/datatypes/Raw.java b/document/src/main/java/com/yahoo/document/datatypes/Raw.java
index f6efc626f06..adae64f3874 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/Raw.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/Raw.java
@@ -100,6 +100,7 @@ public final class Raw extends FieldValue {
}
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
XmlSerializationHelper.printRawXml(this, xml);
}
diff --git a/document/src/main/java/com/yahoo/document/datatypes/ReferenceFieldValue.java b/document/src/main/java/com/yahoo/document/datatypes/ReferenceFieldValue.java
index ebc39b14eb1..75ae0164b65 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/ReferenceFieldValue.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/ReferenceFieldValue.java
@@ -88,6 +88,7 @@ public class ReferenceFieldValue extends FieldValue {
}
@Override
+ @Deprecated
public void printXml(XmlStream xml) { }
@Override
diff --git a/document/src/main/java/com/yahoo/document/datatypes/StringFieldValue.java b/document/src/main/java/com/yahoo/document/datatypes/StringFieldValue.java
index 6133c9ca0ad..6e999bb4041 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/StringFieldValue.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/StringFieldValue.java
@@ -218,6 +218,7 @@ public class StringFieldValue extends FieldValue {
* @param xml the stream to print to
*/
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
XmlSerializationHelper.printStringXml(this, xml);
//TODO: add spanTree printing
diff --git a/document/src/main/java/com/yahoo/document/datatypes/Struct.java b/document/src/main/java/com/yahoo/document/datatypes/Struct.java
index d522e8cda44..11d5db06819 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/Struct.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/Struct.java
@@ -92,6 +92,7 @@ public class Struct extends StructuredFieldValue {
}
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
if (getDataType().equals(PositionDataType.INSTANCE)) {
try {
diff --git a/document/src/main/java/com/yahoo/document/datatypes/TensorFieldValue.java b/document/src/main/java/com/yahoo/document/datatypes/TensorFieldValue.java
index 105739da508..2dab9e97246 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/TensorFieldValue.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/TensorFieldValue.java
@@ -88,6 +88,7 @@ public class TensorFieldValue extends FieldValue {
}
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
// TODO (geirst)
}
diff --git a/document/src/main/java/com/yahoo/document/datatypes/WeightedSet.java b/document/src/main/java/com/yahoo/document/datatypes/WeightedSet.java
index 583c68d631b..08c151b2d51 100644
--- a/document/src/main/java/com/yahoo/document/datatypes/WeightedSet.java
+++ b/document/src/main/java/com/yahoo/document/datatypes/WeightedSet.java
@@ -91,6 +91,7 @@ public final class WeightedSet<K extends FieldValue> extends CollectionFieldValu
@Override
+ @Deprecated
public void printXml(XmlStream xml) {
XmlSerializationHelper.printWeightedSetXml(this, xml);
}
diff --git a/document/src/main/java/com/yahoo/document/serialization/XmlDocumentWriter.java b/document/src/main/java/com/yahoo/document/serialization/XmlDocumentWriter.java
deleted file mode 100644
index aeb4bbe79b1..00000000000
--- a/document/src/main/java/com/yahoo/document/serialization/XmlDocumentWriter.java
+++ /dev/null
@@ -1,339 +0,0 @@
-// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.document.serialization;
-
-import com.yahoo.document.Document;
-import com.yahoo.document.DocumentId;
-import com.yahoo.document.DocumentType;
-import com.yahoo.document.Field;
-import com.yahoo.document.annotation.AnnotationReference;
-import com.yahoo.document.datatypes.Array;
-import com.yahoo.document.datatypes.BoolFieldValue;
-import com.yahoo.document.datatypes.ByteFieldValue;
-import com.yahoo.document.datatypes.CollectionFieldValue;
-import com.yahoo.document.datatypes.DoubleFieldValue;
-import com.yahoo.document.datatypes.FieldValue;
-import com.yahoo.document.datatypes.FloatFieldValue;
-import com.yahoo.document.datatypes.IntegerFieldValue;
-import com.yahoo.document.datatypes.LongFieldValue;
-import com.yahoo.document.datatypes.MapFieldValue;
-import com.yahoo.document.datatypes.PredicateFieldValue;
-import com.yahoo.document.datatypes.Raw;
-import com.yahoo.document.datatypes.ReferenceFieldValue;
-import com.yahoo.document.datatypes.StringFieldValue;
-import com.yahoo.document.datatypes.Struct;
-import com.yahoo.document.datatypes.StructuredFieldValue;
-import com.yahoo.document.datatypes.TensorFieldValue;
-import com.yahoo.document.datatypes.WeightedSet;
-import com.yahoo.vespa.objects.FieldBase;
-import com.yahoo.vespa.objects.Serializer;
-
-import java.nio.ByteBuffer;
-import java.util.ArrayDeque;
-import java.util.Deque;
-import java.util.Iterator;
-import java.util.Map;
-
-// TODO: Just inline all use of XmlSerializationHelper when the toXml methods in FieldValue subclasses are to be removed
-// TODO: More cleanup, the put() methods generate a lot of superfluous objects (write should call put, not the other way around)
-// TODO: remove pingpong between XmlSerializationHelper and FieldValue, this will go away when the toXml methods go away
-/**
- * Render a Document instance as XML.
- *
- * @author Steinar Knutsen
- */
-public final class XmlDocumentWriter implements DocumentWriter {
-
- private final String indent;
- private XmlStream buffer;
- private final Deque<FieldBase> optionalWrapperMarker = new ArrayDeque<>();
-
- public static XmlDocumentWriter createWriter(String indent) {
- return new XmlDocumentWriter(indent);
- }
-
- public XmlDocumentWriter() {
- this(" ");
- }
-
- private XmlDocumentWriter(String indent) {
- this.indent = indent;
- }
-
- // this method is silly, what is the intended way of doing this?
- @Override
- public void write(FieldBase field, FieldValue value) {
- Class<?> valueType = value.getClass();
- if (valueType == AnnotationReference.class) {
- write(field, (AnnotationReference) value);
- } else if (valueType == Array.class) {
- write(field, (Array<?>) value);
- } else if (valueType == WeightedSet.class) {
- write(field, (WeightedSet<?>) value);
- } else if (valueType == Document.class) {
- write(field, (Document) value);
- } else if (valueType == Struct.class) {
- write(field, (Struct) value);
- } else if (valueType == ByteFieldValue.class) {
- write(field, (ByteFieldValue) value);
- } else if (valueType == DoubleFieldValue.class) {
- write(field, (DoubleFieldValue) value);
- } else if (valueType == FloatFieldValue.class) {
- write(field, (FloatFieldValue) value);
- } else if (valueType == IntegerFieldValue.class) {
- write(field, (IntegerFieldValue) value);
- } else if (valueType == LongFieldValue.class) {
- write(field, (LongFieldValue) value);
- } else if (valueType == Raw.class) {
- write(field, (Raw) value);
- } else if (valueType == PredicateFieldValue.class) {
- write(field, (PredicateFieldValue) value);
- } else if (valueType == StringFieldValue.class) {
- write(field, (StringFieldValue) value);
- } else {
- throw new UnsupportedOperationException("Cannot serialize a "
- + valueType.getName());
- }
- }
-
- @Override
- public void write(FieldBase field, Document value) {
- buffer.beginTag("document");
- buffer.addAttribute("documenttype", value.getDataType().getName());
- buffer.addAttribute("documentid", value.getId());
- final java.lang.Long lastModified = value.getLastModified();
- if (lastModified != null) {
- buffer.addAttribute("lastmodifiedtime", lastModified);
- }
- StructuredFieldValue asStructured = value;
- write(null, asStructured);
-
- buffer.endTag();
- }
-
- @Override
- public <T extends FieldValue> void write(FieldBase field, Array<T> value) {
- buffer.beginTag(field.getName());
- XmlSerializationHelper.printArrayXml(value, buffer);
- buffer.endTag();
- }
-
- private void singleValueTag(FieldBase field, FieldValue value) {
- buffer.beginTag(field.getName());
- value.printXml(buffer);
- buffer.endTag();
- }
-
- @Override
- public <K extends FieldValue, V extends FieldValue> void write(FieldBase field, MapFieldValue<K, V> map) {
- // TODO Auto-generated method stub
- buffer.beginTag(field.getName());
- XmlSerializationHelper.printMapXml(map, buffer);
- buffer.endTag();
- }
-
- @Override
- public void write(FieldBase field, ByteFieldValue value) {
- singleValueTag(field, value);
- }
-
- @Override
- public void write(FieldBase field, BoolFieldValue value) {
- singleValueTag(field, value);
- }
-
- @Override
- public <T extends FieldValue> void write(FieldBase field,
- CollectionFieldValue<T> value) {
- buffer.beginTag(field.getName());
- for (@SuppressWarnings("unchecked")
- Iterator<FieldValue> i = (Iterator<FieldValue>) value.iterator();
- i.hasNext();) {
- buffer.beginTag("item");
- i.next().printXml(buffer);
- buffer.endTag();
- }
- buffer.endTag();
- }
-
- @Override
- public void write(FieldBase field, DoubleFieldValue value) {
- singleValueTag(field, value);
- }
-
- @Override
- public void write(FieldBase field, FloatFieldValue value) {
- singleValueTag(field, value);
- }
-
- @Override
- public void write(FieldBase field, IntegerFieldValue value) {
- singleValueTag(field, value);
- }
-
- @Override
- public void write(FieldBase field, LongFieldValue value) {
- singleValueTag(field, value);
- }
-
- @Override
- public void write(FieldBase field, Raw value) {
- buffer.beginTag(field.getName());
- XmlSerializationHelper.printRawXml(value, buffer);
- buffer.endTag();
- }
-
- @Override
- public void write(FieldBase field, PredicateFieldValue value) {
- singleValueTag(field, value);
- }
-
- @Override
- public void write(FieldBase field, StringFieldValue value) {
- buffer.beginTag(field.getName());
- XmlSerializationHelper.printStringXml(value, buffer);
- buffer.endTag();
- }
-
- @Override
- public void write(FieldBase field, TensorFieldValue value) {
- throw new IllegalArgumentException("write() for tensor field value not implemented yet");
- }
-
- @Override
- public void write(FieldBase field, ReferenceFieldValue value) {
- throw new IllegalArgumentException("write() for reference field value not implemented yet");
- }
-
- private void optionalWrapperStart(FieldBase field) {
- if (field == null) {
- return;
- }
-
- optionalWrapperMarker.addFirst(field);
-
- buffer.beginTag(field.getName());
- }
-
- private void optionalWrapperEnd(FieldBase field) {
- if (field == null) {
- return;
- }
-
- if (optionalWrapperMarker.removeFirst() != field) {
- throw new IllegalStateException("Unbalanced optional wrapper tags.");
- }
-
- buffer.endTag();
- }
-
- @Override
- public void write(FieldBase field, Struct value) {
- StructuredFieldValue asStructured = value;
- write(field, asStructured);
- }
-
- @Override
- public void write(FieldBase field, StructuredFieldValue value) {
- optionalWrapperStart(field);
- Iterator<Map.Entry<Field, FieldValue>> i = value.iterator();
- while (i.hasNext()) {
- Map.Entry<Field, FieldValue> v = i.next();
- buffer.beginTag(v.getKey().getName());
- v.getValue().printXml(buffer);
- buffer.endTag();
- }
- optionalWrapperEnd(field);
- }
-
- @Override
- public <T extends FieldValue> void write(FieldBase field,
- WeightedSet<T> value) {
- buffer.beginTag(field.getName());
- XmlSerializationHelper.printWeightedSetXml(value, buffer);
- buffer.endTag();
- }
-
- @Override
- public void write(FieldBase field, AnnotationReference value) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public Serializer putByte(FieldBase field, byte value) {
- singleValueTag(field, new ByteFieldValue(value));
- return this;
- }
-
- @Override
- public Serializer putShort(FieldBase field, short value) {
- singleValueTag(field, new IntegerFieldValue(value));
- return this;
- }
-
- @Override
- public Serializer putInt(FieldBase field, int value) {
- singleValueTag(field, new IntegerFieldValue(value));
- return this;
- }
-
- @Override
- public Serializer putLong(FieldBase field, long value) {
- singleValueTag(field, new LongFieldValue(value));
- return this;
- }
-
- @Override
- public Serializer putFloat(FieldBase field, float value) {
- singleValueTag(field, new FloatFieldValue(value));
- return this;
- }
-
- @Override
- public Serializer putDouble(FieldBase field, double value) {
- singleValueTag(field, new DoubleFieldValue(value));
- return this;
- }
-
- @Override
- public Serializer put(FieldBase field, byte[] value) {
- write(field, new Raw(value));
- return this;
- }
-
- @Override
- public Serializer put(FieldBase field, ByteBuffer value) {
- write(field, new Raw(value));
- return this;
- }
-
- @Override
- public Serializer put(FieldBase field, String value) {
- write(field, new StringFieldValue(value));
- return this;
- }
-
- @Override
- public void write(Document document) {
- buffer = new XmlStream();
- buffer.setIndent(indent);
- optionalWrapperMarker.clear();
- write(new Field(document.getDataType().getName(), 0, document.getDataType()), document);
- }
-
- @Override
- public void write(DocumentId id) {
- throw new UnsupportedOperationException("Writing a DocumentId as XML is not implemented.");
- }
-
- @Override
- public void write(DocumentType type) {
- throw new UnsupportedOperationException("Writing a DocumentId as XML is not implemented.");
-
- }
-
- public String lastRendered() {
- return buffer.toString();
- }
-
-}
diff --git a/document/src/main/java/com/yahoo/document/serialization/XmlSerializationHelper.java b/document/src/main/java/com/yahoo/document/serialization/XmlSerializationHelper.java
index 899ef1f9195..9c1df0cd6c7 100644
--- a/document/src/main/java/com/yahoo/document/serialization/XmlSerializationHelper.java
+++ b/document/src/main/java/com/yahoo/document/serialization/XmlSerializationHelper.java
@@ -30,6 +30,8 @@ import java.util.Map;
*
* @author <a href="mailto:humbe@yahoo-inc.com">H&aring;kon Humberset</a>
*/
+@Deprecated
+@SuppressWarnings("removal")
public class XmlSerializationHelper {
public static void printArrayXml(Array array, XmlStream xml) {
diff --git a/document/src/main/java/com/yahoo/document/serialization/XmlStream.java b/document/src/main/java/com/yahoo/document/serialization/XmlStream.java
index 40ded73b5aa..b9e29d03f7f 100644
--- a/document/src/main/java/com/yahoo/document/serialization/XmlStream.java
+++ b/document/src/main/java/com/yahoo/document/serialization/XmlStream.java
@@ -27,6 +27,7 @@ import java.util.ListIterator;
*
* @author <a href="humbe@yahoo-inc.com">Haakon Humberset</a>
*/
+@Deprecated
public class XmlStream {
// Utility class to hold attributes internally until it's time to write them