Package org.apache.jena.atlas.lib

Examples of org.apache.jena.atlas.lib.InternalErrorException


    @Override
    public void finishPair(long currLine, long currCol)
    {
        if ( value == null )
            throw new InternalErrorException("null for 'value' (bad finishPair() allignment)") ;
       
        String k = keys.pop();
        JsonObject obj = objects.peek() ;
        if ( obj.hasKey(k) )
            Log.warn("JSON", "Duplicate key '"+k+"' for object ["+currLine+","+currCol+"]") ;
View Full Code Here


    public BlankNodeAllocatorHash() {
        reset() ;
        try {
            mDigest = MessageDigest.getInstance(DigestAlgorithm) ;
        } catch (NoSuchAlgorithmException e) {
            throw new InternalErrorException("failed to create message digest", e) ;
        }

        Getter<String, Node> getter = new Getter<String, Node>() {
            @Override
            public Node get(String key) {
View Full Code Here

            if ( lang != null )
                return parserProfile.createLangLiteral(lex, lang, -1, -1) ;
            RDFDatatype dt = NodeFactory.getType(datatype) ;
            return parserProfile.createTypedLiteral(lex, dt, -1, -1) ;
        } else
            throw new InternalErrorException("Node is not a IRI, bNode or a literal: " + type) ;
    }
View Full Code Here

        try {
            e = new StringEntity(content, "UTF-8");
            e.setContentType(contentType);
            execHttpPost(url, e, acceptType, handler, httpClient, httpContext, authenticator);
        } catch (UnsupportedCharsetException e1) {
            throw new InternalErrorException("Platform does not support required UTF-8");
        } catch (UnsupportedEncodingException e1) {
            throw new InternalErrorException("Platform does not support required UTF-8");
        } finally {
            closeEntity(e);
        }
    }
View Full Code Here

        try {
            e = new StringEntity(content, "UTF-8");
            e.setContentType(contentType);
            execHttpPut(url, e, httpClient, httpContext, authenticator);
        } catch (UnsupportedCharsetException e1) {
            throw new InternalErrorException("Platform does not support required UTF-8");
        } catch (UnsupportedEncodingException e1) {
            throw new InternalErrorException("Platform does not support required UTF-8");
        } finally {
            closeEntity(e);
        }
    }
View Full Code Here

            for (Pair p : params.pairs())
                nvps.add(new BasicNameValuePair(p.getName(), p.getValue()));
            HttpEntity e = new UrlEncodedFormEntity(nvps, "UTF-8");
            return e;
        } catch (UnsupportedEncodingException e) {
            throw new InternalErrorException("Platform does not support required UTF-8");
        }
    }
View Full Code Here

        {
            if ( node.isURI() )         return labelForURI(node) ;
            if ( node.isLiteral() )     return labelForLiteral(node) ;
            if ( node.isBlank() )       return labelForBlank(node) ;
            if ( node.isVariable() )    return labelForVar(node) ;
            throw new InternalErrorException("Node type not supported: "+node) ;
        }
View Full Code Here

    private static class ReaderRIOTFactoryJSONLD implements ReaderRIOTFactory
    {
        @Override
        public ReaderRIOT create(Lang language) {
            if ( !Lang.JSONLD.equals(language) )
                throw new InternalErrorException("Attempt to parse " + language + " as JSON-LD") ;
            return new JsonLDReader() ;
        }
View Full Code Here

    }

    private static Triple triple(NodeTable nodeTable, NodeId s, NodeId p, NodeId o)
    {
        if ( ! NodeId.isConcrete(s) )
            throw new InternalErrorException("Invalid id for subject: "+fmt(s,p,o)) ;
        if ( ! NodeId.isConcrete(p) )
            throw new InternalErrorException("Invalid id for predicate: "+fmt(s,p,o)) ;
        if ( ! NodeId.isConcrete(o) )
            throw new InternalErrorException("Invalid id for object: "+fmt(s,p,o)) ;
       
        Node sNode = nodeTable.getNodeForNodeId(s) ;
        if ( sNode == null )
            throw new InternalErrorException("Invalid id node for subject (null node): "+fmt(s,p,o)) ;

        Node pNode = nodeTable.getNodeForNodeId(p) ;
        if ( pNode == null )
        {
            nodeTable.getNodeForNodeId(p) ;
            throw new InternalErrorException("Invalid id node for predicate (null node): "+fmt(s,p,o)) ;
        }
       
        Node oNode = nodeTable.getNodeForNodeId(o) ;
        if ( oNode == null )
            throw new InternalErrorException("Invalid id node for object (null node): "+fmt(s,p,o)) ;
       
        return new Triple(sNode, pNode, oNode) ;
    }
View Full Code Here

        try {
            mbs.unregisterMBean(objName) ;
        }
        catch (InstanceNotFoundException ex) { }    // Meh, whatever
        catch (MBeanRegistrationException ex) {
            throw new InternalErrorException(ex) ;
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jena.atlas.lib.InternalErrorException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.