Skip to content
Snippets Groups Projects
Commit 90862ac8 authored by Olivier Langella's avatar Olivier Langella
Browse files

better saxbase handler, loading X!Tandem identification with new handler

parent 05b3ebb2
No related branches found
No related tags found
No related merge requests found
......@@ -11,10 +11,10 @@ import org.apache.log4j.Logger;
import fr.inra.pappso.xtandempipeline.MsException.MSMSException;
import fr.inra.pappso.xtandempipeline.class_msms.Identification;
import fr.inra.pappso.xtandempipeline.class_msms.MapDb.Peptide;
import fr.inra.pappso.xtandempipeline.sax_parse.HandlerXtResultFile;
import fr.inra.pappso.xtandempipeline.sax_parse.HandlerXtResultFile4ProcessingParams;
import fr.inra.pappso.xtandempipeline.sax_parse.XtandemPhospho;
import fr.inra.pappso.xtandempipeline.sax_parse.parse_file;
import fr.inra.pappso.xtandempipeline.sax_parse.xtandem;
import fr.inra.pappso.xtandempipeline.sax_parse.xtandem_ms2_spectra;
public class IdentificationXtandemFile extends IdentificationDataFile {
......@@ -29,7 +29,8 @@ public class IdentificationXtandemFile extends IdentificationDataFile {
@Override
public Identification loadIdentification(
Identification previousIdentification) throws Exception {
xtandem tandem = new xtandem(previousIdentification, this);
HandlerXtResultFile tandem = new HandlerXtResultFile(
previousIdentification, this);
new parse_file(tandem, this.file);
previousIdentification = tandem.get_identifications();
return previousIdentification;
......
......@@ -70,10 +70,22 @@ public class SaxBaseHandler extends DefaultHandler {
if ("".equals(tag))
tag = qName;
if ((data != null) && (!data.toString().isEmpty())) {
sendData(data.toString());
try {
sendData(data.toString());
} catch (Exception e1) {
logger.error("ERROR parsing data in element "
+ stack.get(stack.size() - 1) + " at line "
+ this.xml_location.getLineNumber() + " and column "
+ this.xml_location.getColumnNumber() + "\n"
+ e1.getMessage());
throw new SAXException("ERROR parsing data in element "
+ stack.get(stack.size() - 1) + " element at line "
+ this.xml_location.getLineNumber() + " and column "
+ this.xml_location.getColumnNumber(), e1);
}
}
stack.push(tag);
data = new StringBuffer();
// String nameSpaceUri, String tag,Attributes attrs
@SuppressWarnings("rawtypes")
......@@ -165,12 +177,13 @@ public class SaxBaseHandler extends DefaultHandler {
}
}
/** send data string in special case
/**
* send data string in special case
*
* @param string
*/
protected void sendData(String string) {
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment