Class JsonMetadata
java.lang.Object
org.apache.tika.metadata.serialization.JsonMetadata
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Metadata
Read metadata from reader.static Metadata
readMetadataObject
(com.fasterxml.jackson.core.JsonParser jParser) expects that jParser has not yet started on object or for jParser to be pointing to the start object.static void
setPrettyPrinting
(boolean prettyPrint) static void
Serializes a Metadata object to Json.
-
Constructor Details
-
JsonMetadata
public JsonMetadata()
-
-
Method Details
-
toJson
Serializes a Metadata object to Json. This does not flush or close the writer.- Parameters:
metadata
- metadata to writewriter
- writer- Throws:
TikaException
- if there is an IOException during writingIOException
-
fromJson
Read metadata from reader.This does not close the reader.
- Parameters:
reader
- reader to read from- Returns:
- Metadata or null if nothing could be read from the reader
- Throws:
IOException
- in case of parse failure or IO failure with Reader
-
readMetadataObject
public static Metadata readMetadataObject(com.fasterxml.jackson.core.JsonParser jParser) throws IOException expects that jParser has not yet started on object or for jParser to be pointing to the start object.- Parameters:
jParser
-- Returns:
- Throws:
IOException
-
setPrettyPrinting
public static void setPrettyPrinting(boolean prettyPrint)
-