use of com.yahoo.document.annotation.SpanNode in project vespa by vespa-engine.
the class VespaDocumentDeserializer42 method readSpanNode.
private SpanNode readSpanNode() {
byte type = buf.get();
buf.position(buf.position() - 1);
SpanNode retval;
if ((type & Span.ID) == Span.ID) {
retval = new Span();
if (spanNodes != null) {
spanNodes.add(retval);
}
read((Span) retval);
} else if ((type & SpanList.ID) == SpanList.ID) {
retval = new SpanList();
if (spanNodes != null) {
spanNodes.add(retval);
}
read((SpanList) retval);
} else if ((type & AlternateSpanList.ID) == AlternateSpanList.ID) {
retval = new AlternateSpanList();
if (spanNodes != null) {
spanNodes.add(retval);
}
read((AlternateSpanList) retval);
} else {
throw new DeserializationException("Cannot read SpanNode of type " + type);
}
return retval;
}
use of com.yahoo.document.annotation.SpanNode in project vespa by vespa-engine.
the class VespaDocumentDeserializer42 method read.
public void read(SpanList spanList) {
byte type = buf.get();
if ((type & SpanList.ID) != SpanList.ID) {
throw new DeserializationException("Cannot deserialize SpanList with type " + type);
}
List<SpanNode> nodes = readSpanList(spanList);
for (SpanNode node : nodes) {
spanList.add(node);
}
}
Aggregations