@Test public void testPdfParserConfig() throws Exception { Map<String, List<TikaProcessor.TikaParserParameter>> parserConfig = getParserConfig(null, "pdf", Collections.singletonMap("pdf", Collections.singletonMap("sort-by-position", "true")), Collections.emptyMap()); assertEquals(1, parserConfig.size()); String pdfParserFullName = "org.apache.tika.parser.pdf.PDFParser"; assertEquals(1, parserConfig.get(pdfParserFullName).size()); assertEquals("sortByPosition", parserConfig.get(pdfParserFullName).get(0).getName()); assertEquals("true", parserConfig.get(pdfParserFullName).get(0).getValue()); }
private static List<TikaParserParameter> getParserConfig(String parserName, Map<String, String> parserParamMap) { List<TikaParserParameter> parserParams = new LinkedList<>(); if (parserParamMap != null) { for (Map.Entry<String, String> entry : parserParamMap.entrySet()) { String paramName = unhyphenate(entry.getKey()); String paramType = getParserParamType(parserName, paramName); parserParams.add(new TikaParserParameter(paramName, entry.getValue(), paramType)); } } return parserParams; }
TikaProcessor { private static List<TikaParserParameter> getParserConfig(String parserName, Map<String, String> parserParamMap) { List<TikaParserParameter> parserParams = new LinkedList<>(); if (parserParamMap != null) { for (Map.Entry<String, String> entry : parserParamMap.entrySet()) { String paramName = unhyphenate(entry.getKey()); String paramType = getParserParamType(parserName, paramName); parserParams.add(new TikaParserParameter(paramName, entry.getValue(), paramType)); } } return parserParams; } }
TikaProcessor { private static List<TikaParserParameter> getParserConfig(String parserName, Map<String, String> parserParamMap) { List<TikaParserParameter> parserParams = new LinkedList<>(); if (parserParamMap != null) { for (Map.Entry<String, String> entry : parserParamMap.entrySet()) { String paramName = unhyphenate(entry.getKey()); String paramType = getParserParamType(parserName, paramName); parserParams.add(new TikaParserParameter(paramName, entry.getValue(), paramType)); } } return parserParams; }  }
TikaProcessor { private static List<TikaParserParameter> getParserConfig(String parserName, Map<String, String> parserParamMap) { List<TikaParserParameter> parserParams = new LinkedList<>(); if (parserParamMap != null) { for (Map.Entry<String, String> entry : parserParamMap.entrySet()) { String paramName = unhyphenate(entry.getKey()); String paramType = getParserParamType(parserName, paramName); parserParams.add(new TikaParserParameter(paramName, entry.getValue(), paramType)); } } return parserParams; }  @BuildStep void registerRuntimeInitializedClasses(BuildProducer<RuntimeInitializedClassBuildItem> resource); @BuildStep void registerTikaCoreResources(BuildProducer<NativeImageResourceBuildItem> resource); @BuildStep void registerTikaParsersResources(BuildProducer<NativeImageResourceBuildItem> resource); @BuildStep void registerPdfBoxResources(BuildProducer<NativeImageResourceDirectoryBuildItem> resource); static Map<String, List<TikaParserParameter>> getSupportedParserConfig(Optional<String> tikaConfigPath,
            Optional<String> requiredParsers,
            Map<String, Map<String, String>> parserParamMaps,
            Map<String, String> parserAbbreviations); static String unhyphenate(String paramName); }
TikaProcessor { private static List<TikaParserParameter> getParserConfig(String parserName, Map<String, String> parserParamMap) { List<TikaParserParameter> parserParams = new LinkedList<>(); if (parserParamMap != null) { for (Map.Entry<String, String> entry : parserParamMap.entrySet()) { String paramName = unhyphenate(entry.getKey()); String paramType = getParserParamType(parserName, paramName); parserParams.add(new TikaParserParameter(paramName, entry.getValue(), paramType)); } } return parserParams; }  @BuildStep void registerRuntimeInitializedClasses(BuildProducer<RuntimeInitializedClassBuildItem> resource); @BuildStep void registerTikaCoreResources(BuildProducer<NativeImageResourceBuildItem> resource); @BuildStep void registerTikaParsersResources(BuildProducer<NativeImageResourceBuildItem> resource); @BuildStep void registerPdfBoxResources(BuildProducer<NativeImageResourceDirectoryBuildItem> resource); static Map<String, List<TikaParserParameter>> getSupportedParserConfig(Optional<String> tikaConfigPath,
            Optional<String> requiredParsers,
            Map<String, Map<String, String>> parserParamMaps,
            Map<String, String> parserAbbreviations); static String unhyphenate(String paramName);  }