@API.Public @API.Factory public final class Json extends Object
Constructor and Description |
---|
Json() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
encode(String jsonString,
Class<T> beanClass) |
static ValueBuilder |
getValueBuilder()
Returns a ValueBuilder object.
|
static Document |
loadDocument(File file)
Loads a JSON file as OJAI Document.
|
static Document |
loadDocument(String filePath)
Loads a JSON file as OJAI Document.
|
static Document |
newDocument()
Returns a new, empty Document.
|
static <T> Document |
newDocument(Map<String,T> map)
Returns a new instance of a Document built from the specified Map.
|
static Document |
newDocument(Object bean)
Returns a new instance of a Document built from the specified Java bean.
|
static Document |
newDocument(String jsonString)
Returns a Document built from the specified JSON string.
|
static DocumentBuilder |
newDocumentBuilder()
Returns a new instance of JSON DocumentBuilder.
|
static DocumentBuilder |
newDocumentBuilder(JsonOptions options)
Returns a new instance of JSON DocumentBuilder with the specified JsonOptions.
|
static DocumentReader |
newDocumentReader(String jsonString)
Returns a new instance of the JSON DocumentReader.
|
static DocumentStream |
newDocumentStream(org.apache.hadoop.fs.FileSystem fs,
String path) |
static DocumentStream |
newDocumentStream(org.apache.hadoop.fs.FileSystem fs,
String path,
Events.Delegate eventDelegate) |
static DocumentStream |
newDocumentStream(org.apache.hadoop.fs.FileSystem fs,
String path,
Map<FieldPath,Value.Type> fieldPathTypeMap) |
static DocumentStream |
newDocumentStream(InputStream in)
Returns a new instance of JSON DocumentStream from the specified InputStream.
|
static DocumentStream |
newDocumentStream(InputStream in,
Events.Delegate eventDelegate) |
static DocumentStream |
newDocumentStream(InputStream in,
Map<FieldPath,Value.Type> fieldPathTypeMap)
Returns a new instance of s JSON DocumentStream from the specified InputStream
using the FieldPath => Type mapping to decode the JSON tokens from the stream.
|
static String |
toJsonString(Document d) |
static String |
toJsonString(Document d,
JsonOptions options) |
static String |
toJsonString(DocumentReader r) |
static String |
toJsonString(DocumentReader r,
JsonOptions options) |
static void |
writeReaderToBuilder(DocumentReader r,
DocumentBuilder w)
Deprecated.
|
public static Document newDocument()
public static Document loadDocument(String filePath) throws IOException
IOException
public static Document loadDocument(File file) throws IOException
IOException
public static ValueBuilder getValueBuilder()
public static Document newDocument(@API.NonNullable String jsonString) throws DecodingException
DecodingException
public static Document newDocument(@API.NonNullable Object bean) throws DecodingException
DecodingException
public static <T> Document newDocument(@API.NonNullable Map<String,T> map) throws DecodingException
DecodingException
public static DocumentReader newDocumentReader(@API.NonNullable String jsonString) throws DecodingException
DecodingException
public static DocumentBuilder newDocumentBuilder()
public static DocumentBuilder newDocumentBuilder(@API.NonNullable JsonOptions options)
public static DocumentStream newDocumentStream(@API.NonNullable InputStream in)
public static DocumentStream newDocumentStream(@API.NonNullable InputStream in, @API.NonNullable Map<FieldPath,Value.Type> fieldPathTypeMap)
public static DocumentStream newDocumentStream(@API.NonNullable InputStream in, @API.NonNullable Events.Delegate eventDelegate)
public static DocumentStream newDocumentStream(@API.NonNullable org.apache.hadoop.fs.FileSystem fs, @API.NonNullable String path) throws DecodingException, IOException
DecodingException
IOException
public static DocumentStream newDocumentStream(@API.NonNullable org.apache.hadoop.fs.FileSystem fs, @API.NonNullable String path, @API.NonNullable Map<FieldPath,Value.Type> fieldPathTypeMap) throws DecodingException, IOException
DecodingException
IOException
public static DocumentStream newDocumentStream(@API.NonNullable org.apache.hadoop.fs.FileSystem fs, @API.NonNullable String path, @API.NonNullable Events.Delegate eventDelegate) throws DecodingException, IOException
DecodingException
IOException
public static <T> T encode(@API.NonNullable String jsonString, @API.NonNullable Class<T> beanClass)
public static String toJsonString(@API.NonNullable Document d)
public static String toJsonString(@API.NonNullable Document d, @API.NonNullable JsonOptions options)
public static String toJsonString(@API.NonNullable DocumentReader r)
public static String toJsonString(@API.NonNullable DocumentReader r, @API.NonNullable JsonOptions options)
public static void writeReaderToBuilder(@API.NonNullable DocumentReader r, @API.NonNullable DocumentBuilder w)
Documents.writeReaderToBuilder(DocumentReader, DocumentBuilder)
Copyright © 2015–2018 MapR Technologies, Inc.. All rights reserved.