private static void setKnownForClass(Class<?> clazz) {
        Field[] fields = clazz.getFields();
        for (Field f : fields) {
            int mod = f.getModifiers();
            if (Modifier.isPublic(mod) && Modifier.isStatic(mod) && Modifier.isFinal(mod)) {
                Class<?> c = f.getType();
                if (String.class.equals(c)) {
                    try {
                        String p = (String) f.get(null);
                        if (p != null) {
                            known.add(p);
                        }
                    } catch (IllegalArgumentException e) {
                        LOG.warn("Illegal argument in field", e);
                    } catch (IllegalAccessException e) {
                        LOG.warn("Illegal access in field", e);
                    }
                }
                if (Property.class.isAssignableFrom(c)) {
                    try {
                        Property p = (Property) f.get(null);
                        if (p != null) {
                            known.add(p.getName());
                        }
                    } catch (IllegalArgumentException e) {
                        LOG.warn("Illegal argument in field", e);
                    } catch (IllegalAccessException e) {
                        LOG.warn("Illegal access in field", e);
                    }
                }
            }
        }
    }
Knowns about all declared {@link Metadata} fields.
Didn't find this functionality anywhere so it was added for
ImageMetadataExtractor, but it can be generalized.
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-image-module/src/main/java/org/apache/tika/parser/image/MetadataFields.java