Search in sources :

Example 1 with ConfigException

use of org.apache.jena.shared.ConfigException in project jena by apache.

the class OntModelImpl method initSyntaxCheckerClass.

// Internal implementation methods
//////////////////////////////////
private static void initSyntaxCheckerClass() {
    if (owlSyntaxCheckerClass == null) {
        try {
            owlSyntaxCheckerClass = Class.forName(owlSyntaxCheckerClassName);
            owlSyntaxCheckerClass.newInstance();
        } catch (Exception e) {
            throw new ConfigException("owlsyntax.jar must be on the classpath.", e);
        }
    }
}
Also used : ConfigException(org.apache.jena.shared.ConfigException) ConfigException(org.apache.jena.shared.ConfigException)

Example 2 with ConfigException

use of org.apache.jena.shared.ConfigException in project jena by apache.

the class RDFReaderFImpl method setBaseReaderClassName.

/**
     * Use RIOT to add custom RDF parsers. See
     * {@code RDFParserRegistry.registerLang}
     * 
     * @deprecated Register with RIOT.
     */
@Deprecated
public static String setBaseReaderClassName(String lang, String className) {
    if (rewiredAlternative != null)
        Log.error(RDFReaderFImpl.class, "Rewired RDFReaderFImpl - configuration changes have no effect on reading");
    String oldClassName = currentEntry(lang);
    try {
        @SuppressWarnings("unchecked") Class<? extends RDFReader> newClass = (Class<? extends RDFReader>) Class.forName(className, false, Thread.currentThread().getContextClassLoader());
        custom.put(lang, newClass);
        return oldClassName;
    } catch (ClassNotFoundException e) {
        throw new ConfigException("Reader not found on classpath", e);
    } catch (Exception e) {
        throw new JenaException(e);
    }
}
Also used : JenaException(org.apache.jena.shared.JenaException) ConfigException(org.apache.jena.shared.ConfigException) RDFReader(org.apache.jena.rdf.model.RDFReader) NoReaderForLangException(org.apache.jena.shared.NoReaderForLangException) JenaException(org.apache.jena.shared.JenaException) ConfigException(org.apache.jena.shared.ConfigException)

Example 3 with ConfigException

use of org.apache.jena.shared.ConfigException in project jena by apache.

the class RDFWriterFImpl method setBaseWriterClassName.

/**
     * Use RIOT to add custom RDF parsers. See
     * {@code RDFWriterRegistry.registerLang}
     * 
     * @deprecated Register with RIOT.
     */
@Deprecated
public static String setBaseWriterClassName(String lang, String className) {
    if (rewiredAlternative != null)
        Log.error(RDFWriterFImpl.class, "Rewired RDFWriterFImpl2 - configuration changes have no effect on writing");
    String oldClassName = currentEntry(lang);
    try {
        @SuppressWarnings("unchecked") Class<? extends RDFWriter> newClass = (Class<? extends RDFWriter>) Class.forName(className, false, Thread.currentThread().getContextClassLoader());
        custom.put(lang, newClass);
        return oldClassName;
    } catch (ClassNotFoundException e) {
        throw new ConfigException("Reader not found on classpath", e);
    } catch (Exception e) {
        throw new JenaException(e);
    }
}
Also used : JenaException(org.apache.jena.shared.JenaException) RDFWriter(org.apache.jena.rdf.model.RDFWriter) ConfigException(org.apache.jena.shared.ConfigException) NoWriterForLangException(org.apache.jena.shared.NoWriterForLangException) JenaException(org.apache.jena.shared.JenaException) ConfigException(org.apache.jena.shared.ConfigException)

Aggregations

ConfigException (org.apache.jena.shared.ConfigException)3 JenaException (org.apache.jena.shared.JenaException)2 RDFReader (org.apache.jena.rdf.model.RDFReader)1 RDFWriter (org.apache.jena.rdf.model.RDFWriter)1 NoReaderForLangException (org.apache.jena.shared.NoReaderForLangException)1 NoWriterForLangException (org.apache.jena.shared.NoWriterForLangException)1