Package com.yahoo.document.json
Class JsonReader
- java.lang.Object
-
- com.yahoo.document.json.JsonReader
-
public class JsonReader extends Object
Initialize Vespa documents/updates/removes from an InputStream containing a valid JSON representation of a feed.- Author:
- Steinar Knutsen, dybis
-
-
Constructor Summary
Constructors Constructor Description JsonReader(DocumentTypeManager typeManager, InputStream input, com.fasterxml.jackson.core.JsonFactory parserFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DocumentOperation
next()
Returns the next document operation, or null if we have reached the endcom.fasterxml.jackson.core.JsonToken
nextToken(com.fasterxml.jackson.core.JsonParser parser)
Optional<DocumentParseInfo>
parseDocument()
DocumentType
readDocumentType(DocumentId docId)
DocumentOperation
readSingleDocument(DocumentOperationType operationType, String docIdString)
Reads a single operation.
-
-
-
Constructor Detail
-
JsonReader
public JsonReader(DocumentTypeManager typeManager, InputStream input, com.fasterxml.jackson.core.JsonFactory parserFactory)
-
-
Method Detail
-
parseDocument
public Optional<DocumentParseInfo> parseDocument() throws IOException
- Throws:
IOException
-
readSingleDocument
public DocumentOperation readSingleDocument(DocumentOperationType operationType, 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
-
readDocumentType
public DocumentType readDocumentType(DocumentId docId)
-
nextToken
public com.fasterxml.jackson.core.JsonToken nextToken(com.fasterxml.jackson.core.JsonParser parser)
-
-