Class JsonReader


  • public class JsonReader
    extends java.lang.Object
    Initialize Vespa documents/updates/removes from an InputStream containing a valid JSON representation of a feed.
    Author:
    Steinar Knutsen, dybis
    • Constructor Detail

      • JsonReader

        public JsonReader​(DocumentTypeManager typeManager,
                          java.io.InputStream input,
                          com.fasterxml.jackson.core.JsonFactory parserFactory)
    • Method Detail

      • parseDocument

        public java.util.Optional<DocumentParseInfo> parseDocument()
                                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • readSingleDocument

        public DocumentOperation readSingleDocument​(DocumentParser.SupportedOperation operationType,
                                                    java.lang.String docIdString)
        Reads a single operation. The operation is not expected to be part of an array.
        Parameters:
        operationType - the type of operation (update or put)
        docIdString - document ID.
        Returns:
        the document
      • next

        public DocumentOperation next()
        Returns the next document operation, or null if we have reached the end
      • nextToken

        public com.fasterxml.jackson.core.JsonToken nextToken​(com.fasterxml.jackson.core.JsonParser parser)