Search in sources :

Example 1 with GrddlTransformException

use of com.thoughtworks.studios.shine.semweb.grddl.GrddlTransformException in project gocd by gocd.

the class NUnitRDFizer method importFile.

public Graph importFile(final String parentURI, Document document) throws GrddlTransformException {
    final DocumentResult result = new DocumentResult();
    final DocumentSource source = new DocumentSource(document);
    try {
        return xsltTransformerRegistry.transformWithCorrectClassLoader(XSLTTransformerRegistry.XUNIT_NUNIT_TO_JUNIT_XSL, new XSLTTransformerExecutor<Graph>() {

            @Override
            public Graph execute(Transformer transformer) throws TransformerException, GrddlTransformException {
                transformer.transform(source, result);
                return jUnitRDFizer.importFile(parentURI, result.getDocument());
            }
        });
    } catch (TransformerException e) {
        throw new ShineRuntimeException(e);
    }
}
Also used : Graph(com.thoughtworks.studios.shine.semweb.Graph) Transformer(javax.xml.transform.Transformer) ShineRuntimeException(com.thoughtworks.studios.shine.ShineRuntimeException) DocumentResult(org.dom4j.io.DocumentResult) DocumentSource(org.dom4j.io.DocumentSource) GrddlTransformException(com.thoughtworks.studios.shine.semweb.grddl.GrddlTransformException) TransformerException(javax.xml.transform.TransformerException)

Aggregations

ShineRuntimeException (com.thoughtworks.studios.shine.ShineRuntimeException)1 Graph (com.thoughtworks.studios.shine.semweb.Graph)1 GrddlTransformException (com.thoughtworks.studios.shine.semweb.grddl.GrddlTransformException)1 Transformer (javax.xml.transform.Transformer)1 TransformerException (javax.xml.transform.TransformerException)1 DocumentResult (org.dom4j.io.DocumentResult)1 DocumentSource (org.dom4j.io.DocumentSource)1