|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tika.parser.AbstractParser
org.apache.tika.parser.CompositeParser
org.apache.tika.parser.AutoDetectParser
public class AutoDetectParser
| Constructor Summary | |
|---|---|
AutoDetectParser()
Creates an auto-detecting parser instance using the default Tika configuration. |
|
AutoDetectParser(Detector detector)
|
|
AutoDetectParser(Detector detector,
Parser... parsers)
|
|
AutoDetectParser(Parser... parsers)
Creates an auto-detecting parser instance using the specified set of parser. |
|
AutoDetectParser(TikaConfig config)
|
|
| Method Summary | |
|---|---|
Detector |
getDetector()
Returns the type detector used by this parser to auto-detect the type of a document. |
void |
parse(InputStream stream,
ContentHandler handler,
Metadata metadata)
Calls the Parser.parse(InputStream, ContentHandler, Metadata, ParseContext)
method with an empty ParseContext. |
void |
parse(InputStream stream,
ContentHandler handler,
Metadata metadata,
ParseContext context)
Delegates the call to the matching component parser. |
void |
setDetector(Detector detector)
Sets the type detector used by this parser to auto-detect the type of a document. |
| Methods inherited from class org.apache.tika.parser.CompositeParser |
|---|
findDuplicateParsers, getFallback, getMediaTypeRegistry, getParser, getParser, getParsers, getParsers, getSupportedTypes, setFallback, setMediaTypeRegistry, setParsers |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AutoDetectParser()
public AutoDetectParser(Detector detector)
public AutoDetectParser(Parser... parsers)
detector - Detector to useparsers -
public AutoDetectParser(Detector detector,
Parser... parsers)
public AutoDetectParser(TikaConfig config)
| Method Detail |
|---|
public Detector getDetector()
public void setDetector(Detector detector)
detector - type detector
public void parse(InputStream stream,
ContentHandler handler,
Metadata metadata,
ParseContext context)
throws IOException,
SAXException,
TikaException
CompositeParser
Potential RuntimeExceptions, IOExceptions and
SAXExceptions unrelated to the given input stream and content
handler are automatically wrapped into TikaExceptions to better
honor the Parser contract.
parse in interface Parserparse in class CompositeParserstream - the document stream (input)handler - handler for the XHTML SAX events (output)metadata - document metadata (input and output)context - parse context
IOException - if the document stream could not be read
SAXException - if the SAX events could not be processed
TikaException - if the document could not be parsed
public void parse(InputStream stream,
ContentHandler handler,
Metadata metadata)
throws IOException,
SAXException,
TikaException
AbstractParserParser.parse(InputStream, ContentHandler, Metadata, ParseContext)
method with an empty ParseContext. This method exists as a
leftover from Tika 0.x when the three-argument parse() method still
existed in the Parser interface. No new code should call this
method anymore, it's only here for backwards compatibility.
parse in class AbstractParserIOException
SAXException
TikaException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||