XmlFileRecordReader.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:datasource 作者:
/**
 * @param dataFile
 * @throws FileNotFoundException
 * @throws XMLStreamException
 * @throws JAXBException
 */
private void initialize(InputStream is) throws FileNotFoundException, XMLStreamException, JAXBException {
    this.is = is;
    ctx = JAXBContext.newInstance(entryClass);
    um = ctx.createUnmarshaller();
    XMLInputFactory xmlif = XMLInputFactory.newInstance();
    xmler = xmlif.createXMLEventReader(is);
    EventFilter filter = new EventFilter() {
        public boolean accept(XMLEvent event) {
            return event.isStartElement();
        }
    };
    xmlfer = xmlif.createFilteredReader(xmler, filter);
    // Jump to the first element in the document, the enclosing Uniprot in
    // the case of uniprot
    // xml
    StartElement e = (StartElement) xmlfer.nextEvent();
    advanceToRecordWithTaxonOfInterest();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号