Tika DefaultParser 如何找到实现类

通过在METE-INF下的services包里建立相应的文件,文件名是
org.apache.tika.parser.Parser接口的名字。而文件内容是其所有实现类的全名。在DefaultParser里通过
https://connect8.uc.att.com/dstsystems/SyncEvents/WaitingRoom.asp?RM=1&LessonID=0&CreateEvent=0&MeetID=84354464&[email protected]&Lname=HT&fName=Hengtian&MeetingKey=

List<Parser> parsers = new ArrayList<Parser>();
        if (loader != null) {
            Iterator<Parser> iterator =
                ServiceRegistry.lookupProviders(Parser.class, loader);
            while (iterator.hasNext()) {
                parsers.add(iterator.next());
            }
       }
来得到所有实现类

org.apache.tika.parser.asm.ClassParser
org.apache.tika.parser.audio.AudioParser
org.apache.tika.parser.audio.MidiParser
org.apache.tika.parser.dwg.DWGParser
org.apache.tika.parser.epub.EpubParser
org.apache.tika.parser.feed.FeedParser
org.apache.tika.parser.font.TrueTypeParser
org.apache.tika.parser.html.HtmlParser
org.apache.tika.parser.image.ImageParser
org.apache.tika.parser.image.TiffParser
org.apache.tika.parser.iwork.IWorkParser
org.apache.tika.parser.iwork.IWorkPackageParser
org.apache.tika.parser.jpeg.JpegParser
org.apache.tika.parser.mbox.MboxParser
org.apache.tika.parser.microsoft.OfficeParser
org.apache.tika.parser.microsoft.ooxml.OOXMLParser
org.apache.tika.parser.mp3.Mp3Parser
org.apache.tika.parser.hdf.HDFParser
org.apache.tika.parser.netcdf.NetCDFParser
org.apache.tika.parser.odf.OpenDocumentParser
org.apache.tika.parser.pdf.PDFParser
org.apache.tika.parser.pkg.PackageParser
org.apache.tika.parser.rtf.RTFParser
org.apache.tika.parser.txt.TXTParser
org.apache.tika.parser.video.FLVParser
org.apache.tika.parser.xml.DcXMLParser

你可能感兴趣的:(parser)