Search in sources :

Example 1 with SaxHandler

use of com.dexels.navajo.document.saximpl.SaxHandler in project navajo by Dexels.

the class BaseNavajoFactoryImpl method createNavajo.

@Override
public Navajo createNavajo(InputStream stream) {
    try {
        QDParser parser = new QDParser();
        SaxHandler sax = new SaxHandler(parser);
        try (Reader isr = new InputStreamReader(stream, StandardCharsets.UTF_8)) {
            parser.parse(sax, isr);
        }
        return sax.getNavajo();
    } catch (Exception e) {
        throw NavajoFactory.getInstance().createNavajoException(e);
    }
}
Also used : InputStreamReader(java.io.InputStreamReader) QDParser(com.dexels.navajo.document.saximpl.qdxml.QDParser) Reader(java.io.Reader) InputStreamReader(java.io.InputStreamReader) SaxHandler(com.dexels.navajo.document.saximpl.SaxHandler) NavascriptSaxHandler(com.dexels.navajo.document.saximpl.NavascriptSaxHandler) NavajoException(com.dexels.navajo.document.NavajoException)

Example 2 with SaxHandler

use of com.dexels.navajo.document.saximpl.SaxHandler in project navajo by Dexels.

the class BaseNavajoFactoryImpl method createNavajo.

@Override
public Navajo createNavajo(Reader r) {
    try {
        QDParser parser = new QDParser();
        SaxHandler sax = new SaxHandler(parser);
        parser.parse(sax, r);
        return sax.getNavajo();
    } catch (Exception e) {
        throw NavajoFactory.getInstance().createNavajoException(e);
    }
}
Also used : QDParser(com.dexels.navajo.document.saximpl.qdxml.QDParser) SaxHandler(com.dexels.navajo.document.saximpl.SaxHandler) NavascriptSaxHandler(com.dexels.navajo.document.saximpl.NavascriptSaxHandler) NavajoException(com.dexels.navajo.document.NavajoException)

Aggregations

NavajoException (com.dexels.navajo.document.NavajoException)2 NavascriptSaxHandler (com.dexels.navajo.document.saximpl.NavascriptSaxHandler)2 SaxHandler (com.dexels.navajo.document.saximpl.SaxHandler)2 QDParser (com.dexels.navajo.document.saximpl.qdxml.QDParser)2 InputStreamReader (java.io.InputStreamReader)1 Reader (java.io.Reader)1