Class MetadataValueTypes

java.lang.Object
org.apache.tika.serialization.MetadataValueTypes

public final class MetadataValueTypes extends Object
Value types of metadata keys for typed JSON output.

The Property registry knows a key only once its declaring class has loaded in this JVM. A pipes parent (tika-server's /rmeta, for one) serializes metadata from parsers and plugins it never loads, so the fork reports the types of the keys it wrote (describe(java.util.List<org.apache.tika.metadata.Metadata>)) and the parent records them (learn(java.lang.String, java.lang.String)) before serializing.

  • Method Details

    • get

      public static Property.ValueType get(String key)
      Returns:
      the key's type from its Property declaration in this JVM, else as reported by a fork, else null
    • describe

      public static Map<String,Property.ValueType> describe(List<Metadata> metadataList)
      Returns:
      the keys in the list that typed output writes as other than strings, with their types
    • learn

      public static void learn(String key, String typeName)
      Records a type reported by a fork. Ignored when this JVM declares the key itself, the key was already learned, the type name is unknown or written as a string, or the cap is reached.