Example usage for org.xml.sax SAXException SAXException

List of usage examples for org.xml.sax SAXException SAXException

Introduction

In this page you can find the example usage for org.xml.sax SAXException SAXException.

Prototype

public SAXException(Exception e) 

Source Link

Document

Create a new SAXException wrapping an existing exception.

Usage

From source file:org.intermine.bio.dataconversion.KeggConverter.java

private void processMapTitleFile(Reader reader) throws IOException, ObjectStoreException, SAXException {
    Iterator lineIter = FormattedTextParser.parseTabDelimitedReader(reader);

    while (lineIter.hasNext()) {
        String[] line = (String[]) lineIter.next();
        String pathwayKey = line[0];
        String pathwayName = line[1];
        if (!StringUtils.isEmpty(pathwayKey)) {
            Item pathway = getPathway(pathwayKey);
            pathway.setAttribute("name", pathwayName);
            try {
                store(pathway);//  w  ww  . java  2s . c  om
            } catch (ObjectStoreException e) {
                throw new SAXException(e);
            }
        }
    }
}

From source file:org.intermine.bio.dataconversion.KeggConverter.java

private void processGeneMapFile(Reader reader) throws Exception {

    Iterator lineIter = FormattedTextParser.parseDelimitedReader(reader, '|');

    while (lineIter.hasNext()) {
        String[] line = (String[]) lineIter.next();
        String entrezId = line[0];
        String[] pathwayIds = line[4].split(" ");
        String geneId = line[2];/* ww  w  .  ja  v  a2 s  . c  om*/
        Item gene = getGene(geneId);
        gene.setAttribute("secondaryIdentifier", entrezId);

        for (int i = 0; i < pathwayIds.length; i++) {
            //System.out.println("test "+geneId+" "+i);
            String pathwayId = pathwayIds[i];
            if (!StringUtils.isEmpty(pathwayId)) {
                //System.out.println("pathwayId found: "+pathwayId);
                Item pathway = getPathway(pathwayId);
                if (pathway == null) {
                    System.out.println("pathway not found: " + geneId + " " + pathwayId);
                }
                gene.addToCollection("pathways", pathway);
            }
        }

        try {
            store(gene);
        } catch (ObjectStoreException e) {
            throw new SAXException(e);
        }
    }
}

From source file:validation.xslt.handler.XsltResultHandler.java

/** SAX handling, Receive notification of the end of an element.
 * // w w  w. ja  v  a 2s.  com
 * @param namespaceURI The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
 * @param localName The local name (without prefix), or the empty string if Namespace processing is not being performed.
 * @param qName The qualified name (with prefix), or the empty string if qualified names are not available.
 * @throws SAXException Any SAX exception, possibly wrapping another exception.
 */
@Override
public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
    if (qName.compareTo(FAILED) == 0) {
        if (failed) {
            buffer.append("</");
            buffer.append(qName);
            buffer.append(">");
            throw new SAXException(NORMAL_STATUS);
        }
    }
}