Package org.springframework.ai.reader
Class JsonReader
java.lang.Object
org.springframework.ai.reader.JsonReader
- All Implemented Interfaces:
- Supplier<List<Document>>,- DocumentReader
A class that reads JSON documents and converts them into a list of 
Document
 objects.- Since:
- 1.0.0
- Author:
- Mark Pollack, Christian Tzolov, rivkode rivkode
- 
Constructor SummaryConstructorsConstructorDescriptionJsonReader(org.springframework.core.io.Resource resource) JsonReader(org.springframework.core.io.Resource resource, String... jsonKeysToUse) JsonReader(org.springframework.core.io.Resource resource, JsonMetadataGenerator jsonMetadataGenerator, String... jsonKeysToUse) 
- 
Method SummaryMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.ai.document.DocumentReaderread
- 
Constructor Details- 
JsonReaderpublic JsonReader(org.springframework.core.io.Resource resource) 
- 
JsonReader
- 
JsonReaderpublic JsonReader(org.springframework.core.io.Resource resource, JsonMetadataGenerator jsonMetadataGenerator, String... jsonKeysToUse) 
 
- 
- 
Method Details- 
get
- 
get
- 
getRetrieves documents from the JSON resource using a JSON Pointer.- Parameters:
- pointer- A JSON Pointer string (RFC 6901) to locate the desired element
- Returns:
- A list of Documents parsed from the located JSON element
- Throws:
- RuntimeException- if the JSON cannot be parsed or the pointer is invalid
 
 
-