private static DocumentType getDocumentTypeFromString(String docTypeString, DocumentTypeManager typeManager) {
        final DocumentType docType = typeManager.getDocumentType(docTypeString);
        if (docType == null)
            throw new IllegalArgumentException(String.format("Document type %s does not exist", docTypeString));
        return docType;
    }
Returns the next document operation, or null if we have reached the end
document/src/main/java/com/yahoo/document/json/JsonReader.java