public class JsonMetadataList extends JsonMetadataBase
Modifier and Type | Field and Description |
---|---|
private static com.google.gson.Gson |
GSON |
private static java.lang.reflect.Type |
listType |
Constructor and Description |
---|
JsonMetadataList() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<Metadata> |
fromJson(java.io.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(java.util.List<Metadata> metadataList,
java.io.Writer writer)
Serializes a Metadata object to Json.
|
defaultInit, prettyInit
private static final java.lang.reflect.Type listType
private static com.google.gson.Gson GSON
public static void toJson(java.util.List<Metadata> metadataList, java.io.Writer writer) throws TikaException
metadataList
- list of metadata to writewriter
- writerTikaException
- if there is an IOException during writingpublic static java.util.List<Metadata> fromJson(java.io.Reader reader) throws TikaException
reader
- 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)