Package com.yahoo.document.json
Class JsonReader
java.lang.Object
com.yahoo.document.json.JsonReader
Initialize Vespa documents/updates/removes from an InputStream containing a
valid JSON representation of a feed.
- Author:
- Steinar Knutsen, dybis
-
Constructor Summary
ConstructorDescriptionJsonReader
(DocumentTypeManager typeManager, InputStream input, com.fasterxml.jackson.core.JsonFactory parserFactory) -
Method Summary
Modifier and TypeMethodDescriptionnext()
Returns the next document operation, or null if we have reached the endcom.fasterxml.jackson.core.JsonToken
nextToken
(com.fasterxml.jackson.core.JsonParser parser) readDocumentType
(DocumentId docId) readSingleDocumentStreaming
(DocumentOperationType operationType, String docIdString) Reads a JSON which is expected to contain a single document operation, and where other parameters, like the document ID and operation type, are supplied by other means.
-
Constructor Details
-
JsonReader
public JsonReader(DocumentTypeManager typeManager, InputStream input, com.fasterxml.jackson.core.JsonFactory parserFactory)
-
-
Method Details
-
parseDocument
- Throws:
IOException
-
readSingleDocumentStreaming
public ParsedDocumentOperation readSingleDocumentStreaming(DocumentOperationType operationType, String docIdString) Reads a JSON which is expected to contain a single document operation, and where other parameters, like the document ID and operation type, are supplied by other means.- Parameters:
operationType
- the type of operation (update or put)docIdString
- document ID- Returns:
- the parsed document operation
-
next
Returns the next document operation, or null if we have reached the end -
readDocumentType
-
nextToken
public com.fasterxml.jackson.core.JsonToken nextToken(com.fasterxml.jackson.core.JsonParser parser)
-