public static umich . ms . fileio . filetypes . mzidentml . jaxb . standard . MzIdentMLType parse ( Path path ) throws FileParsingException { try { XMLStreamReader xsr = JaxbUtils . createXmlStreamReader ( path , false ) ; umich . ms . fileio . filetypes . mzidentml . jaxb . standard . MzIdentMLType mzIdentMLType = JaxbUtils . unmarshal ( umich . ms . fileio . filetypes . mzidentml . jaxb . standard . MzIdentMLType . class , xsr ) ; return mzIdentMLType ; } catch ( JAXBException e ) { throw new FileParsingException ( String . format ( "JAXB parsing of MzIdentML file failed (%s)" , path . toAbsolutePath ( ) . toString ( ) ) , e ) ; } }
Will parse the whole file . Might be not very efficient memory - wise .