Search in sources :

Example 1 with QDParser

use of com.dexels.navajo.document.saximpl.qdxml.QDParser 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 QDParser

use of com.dexels.navajo.document.saximpl.qdxml.QDParser 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)

Example 3 with QDParser

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

the class BaseNavajoFactoryImpl method createNavaScript.

@Override
public Navascript createNavaScript(FileInputStream fis, MapDefinitionInterrogator mapDefinitionInterrogator) {
    try {
        QDParser parser = new QDParser();
        NavascriptSaxHandler sax = new NavascriptSaxHandler(parser);
        sax.setMapChecker(mapDefinitionInterrogator);
        try (Reader isr = new InputStreamReader(fis, StandardCharsets.UTF_8)) {
            parser.parse(sax, isr);
        }
        NavascriptTag nt = (NavascriptTag) sax.getNavascript();
        nt.setMapChecker(mapDefinitionInterrogator);
        return nt;
    } 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) NavascriptSaxHandler(com.dexels.navajo.document.saximpl.NavascriptSaxHandler) NavascriptTag(com.dexels.navajo.document.navascript.tags.NavascriptTag) NavajoException(com.dexels.navajo.document.NavajoException)

Example 4 with QDParser

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

the class BaseNavajoFactoryImpl method createNavaScript.

@Override
public Navascript createNavaScript(java.io.InputStream stream) {
    try {
        QDParser parser = new QDParser();
        NavascriptSaxHandler sax = new NavascriptSaxHandler(parser);
        try (Reader isr = new InputStreamReader(stream, StandardCharsets.UTF_8)) {
            parser.parse(sax, isr);
        }
        return sax.getNavascript();
    } 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) NavascriptSaxHandler(com.dexels.navajo.document.saximpl.NavascriptSaxHandler) NavajoException(com.dexels.navajo.document.NavajoException)

Aggregations

NavajoException (com.dexels.navajo.document.NavajoException)4 NavascriptSaxHandler (com.dexels.navajo.document.saximpl.NavascriptSaxHandler)4 QDParser (com.dexels.navajo.document.saximpl.qdxml.QDParser)4 InputStreamReader (java.io.InputStreamReader)3 Reader (java.io.Reader)3 SaxHandler (com.dexels.navajo.document.saximpl.SaxHandler)2 NavascriptTag (com.dexels.navajo.document.navascript.tags.NavascriptTag)1