public class JsonMetadata extends JsonMetadataBase
| Constructor and Description |
|---|
JsonMetadata() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.tika.metadata.Metadata |
fromJson(Reader reader)
Read metadata from reader.
|
static void |
setGson(com.google.gson.Gson gson)
Enables setting custom configurations on Gson.
|
static void |
setPrettyPrinting(boolean prettyPrint) |
static void |
toJson(org.apache.tika.metadata.Metadata metadata,
Writer writer)
Serializes a Metadata object to Json.
|
public static void toJson(org.apache.tika.metadata.Metadata metadata,
Writer writer)
throws org.apache.tika.exception.TikaException
metadata - metadata to writewriter - writerorg.apache.tika.exception.TikaException - if there is an IOException during writingpublic static org.apache.tika.metadata.Metadata fromJson(Reader reader) throws org.apache.tika.exception.TikaException
reader - reader to read fromorg.apache.tika.exception.TikaException - in case of parse failure by Gson or IO failure with Readerpublic static void setGson(com.google.gson.Gson gson)
gson - public static void setPrettyPrinting(boolean prettyPrint)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.