Package ai.platon.pulsar.crawl.parse
Class ParserFactory
-
- All Implemented Interfaces:
public final class ParserFactoryCreates Parser.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classParserFactory.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static StringDEFAULT_MINE_TYPEpublic final static ParserFactory.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description ParserFactory(List<Parser> availableParsers, ImmutableConfig conf)ParserFactory(ParserConfig parserConfig, List<Parser> availableParsers, ImmutableConfig conf)ParserFactory(Map<String, List<Parser>> parses, ImmutableConfig conf)ParserFactory(ImmutableConfig conf)
-
Method Summary
-
-
Constructor Detail
-
ParserFactory
ParserFactory(ParserConfig parserConfig, List<Parser> availableParsers, ImmutableConfig conf)
-
ParserFactory
ParserFactory(ImmutableConfig conf)
-
-
Method Detail
-
getParsers
final List<Parser> getParsers(String contentType, String url)
Function returns an array of Parsers for a given content type.
The function consults the internal list of parse plugins for the ParserFactory to determine the list of pluginIds, then gets the appropriate extension points to instantiate as Parsers.
The function is thread safe
- Parameters:
contentType- The contentType to return theArrayof Parser's for.url- The url for the content that may allow us to get the type from the file suffix.
-
-
-
-