|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object 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(TikaConfig config)
|
Method Summary | |
---|---|
Detector |
getDetector()
Returns the type detector used by this parser to auto-detect the type of a document. |
void |
parse(java.io.InputStream stream,
org.xml.sax.ContentHandler handler,
Metadata metadata)
The parse() method from Tika 0.4 and earlier. |
void |
parse(java.io.InputStream stream,
org.xml.sax.ContentHandler handler,
Metadata metadata,
ParseContext context)
Delegates the call to the matching component parser. |
void |
setConfig(TikaConfig config)
|
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 |
---|
getFallback, getParser, getParsers, setFallback, 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(TikaConfig config)
Method Detail |
---|
public void setConfig(TikaConfig config)
public Detector getDetector()
public void setDetector(Detector detector)
setConfig(TikaConfig)
method will override the type detector setting with the type settings
included in the given configuration.
detector
- type detectorpublic void parse(java.io.InputStream stream, org.xml.sax.ContentHandler handler, Metadata metadata, ParseContext context) throws java.io.IOException, org.xml.sax.SAXException, TikaException
CompositeParser
Potential RuntimeException
s, IOException
s and
SAXException
s unrelated to the given input stream and content
handler are automatically wrapped into TikaException
s to better
honor the Parser
contract.
parse
in interface Parser
parse
in class CompositeParser
stream
- the document stream (input)handler
- handler for the XHTML SAX events (output)metadata
- document metadata (input and output)context
- parse context
java.io.IOException
- if the document stream could not be read
org.xml.sax.SAXException
- if the SAX events could not be processed
TikaException
- if the document could not be parsedpublic void parse(java.io.InputStream stream, org.xml.sax.ContentHandler handler, Metadata metadata) throws java.io.IOException, org.xml.sax.SAXException, TikaException
Parser
#parse(InputStream, ContentHandler, Metadata, Map)
method
instead in new code. Calls to this backwards compatibility method
are forwarded to the new parse() method with an empty parse context.
parse
in interface Parser
parse
in class CompositeParser
java.io.IOException
org.xml.sax.SAXException
TikaException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |