Package org.apache.jena.riot

Examples of org.apache.jena.riot.RiotException


       
        /** report an error - do not carry on */
        @Override
        public void error(String message, long line, long col)
        {
            throw new RiotException(fmtMessage(message, line, col)) ;
        }
View Full Code Here


        }

        @Override
        public void fatal(String message, long line, long col)
        {
            throw new RiotException(fmtMessage(message, line, col)) ;
        }
View Full Code Here

        @Override
        public void fatal(String message, long line, long col)
        {
            logFatal(message, line, col) ;
            throw new RiotException(SysRIOT.fmtMessage(message, line, col)) ;
        }
View Full Code Here

    static Token create(String s)
    {
        PeekReader pr = PeekReader.readString(s) ;
        TokenizerText tt = new TokenizerText(pr) ;
        if ( ! tt.hasNext() )
            throw new RiotException("No token") ;
        Token t = tt.next() ;
        if ( tt.hasNext() )
            throw new RiotException("Extraneous charcaters") ;
        return t ;
    }
View Full Code Here

            case PREFIXED_NAME :
                if ( pmap == null )
                    return NodeFactory.createURI("urn:prefixed-name:"+tokenImage+":"+tokenImage2) ;
                String x = pmap.expand(tokenImage, tokenImage2) ;
                if ( x == null )
                    throw new RiotException("Can't expand prefixed name: "+this) ;
                return NodeFactory.createURI(x) ;
            case DECIMAL :  return NodeFactory.createLiteral(tokenImage, null, XSDDatatype.XSDdecimal;
            case DOUBLE :   return NodeFactory.createLiteral(tokenImage, null, XSDDatatype.XSDdouble;
            case INTEGER:   return NodeFactory.createLiteral(tokenImage, null, XSDDatatype.XSDinteger) ;
            case LITERAL_DT :
            {
                Token lexToken = getSubToken1() ;
                Token dtToken  = getSubToken2() ;
               
                if ( pmap == null && dtToken.hasType(TokenType.PREFIXED_NAME) )
                    // Must be able to resolve the datattype else we can't find it's datatype.
                    throw new RiotException("Invalid token: "+this) ;
                Node n = dtToken.asNode(pmap);
                if ( ! n.isURI() )
                    throw new RiotException("Invalid token: "+this) ;
                RDFDatatype dt = TypeMapper.getInstance().getSafeTypeByName(n.getURI()) ;
                return NodeFactory.createLiteral(lexToken.getImage(), null, dt;
            }
            case LITERAL_LANG : return NodeFactory.createLiteral(tokenImage, tokenImage2, null;
            case STRING:
View Full Code Here

    if ( s.isBlank() ) {
      out.key("_:" + s.getBlankNodeLabel()) ;
    } else if ( s.isURI() ) {
      out.key(s.getURI()) ;
    } else {
      throw new RiotException ("Only URIs or blank nodes are legal subjects.") ;
    }
    out.startObject() ;
    // out.pair(key, value) ;
    Map<Node, Set<Node>> predicates = item.getRight() ;
    for (Node p : predicates.keySet() ) {
View Full Code Here

        if (!showExceptions)
            return iri ;
        if (!iri.hasViolation(false))
            return iri ;
        String msg = iri.violations(false).next().getShortMessage() ;
        throw new RiotException(msg) ;
    }
View Full Code Here

    {
        if (!connected)
            throw new IllegalStateException("Pipe not connected");
       
        if (closedByReader)
            throw new RiotException("Pipe closed");
       
        if (finished)
            return false;
       
        readSide = Thread.currentThread();
       
        if (slot != null)
            return true ;
        while (true)
        {
            try
            {
                slot = queue.poll(ITERATOR_POLL_TIMEOUT, ITERATOR_POLL_TIMEUNIT) ;
            }
            catch (InterruptedException e)
            {
                throw new CancellationException() ;
            }

            if (null != slot)
                break ;
           
            // If the producer thread died and did not call finish() then declare this pipe to be "broken"
            // Since check is after the break, we will drain as much as possible out of the queue before throwing this exception
            if (writeSide != null && !writeSide.isAlive() && !closedByWriter)
            {
                closedByReader = true ;
                throw new RiotException("Write end dead") ;
            }
        }

        // When the end marker is seen set slot to null
        if (slot == endMarker)
View Full Code Here

   
    private void checkStateForReceive()
    {
        if (closedByWriter || closedByReader)
        {
            throw new RiotException("Pipe closed") ;
        }
        else if (readSide != null && !readSide.isAlive())
        {
            throw new RiotException("Read end dead") ;
        }
    }
View Full Code Here

        {
            com.hp.hpl.jena.util.LocatorZip zipLoc = (com.hp.hpl.jena.util.LocatorZip)oldloc ;
            return new LocatorZip(zipLoc.getZipFileName()) ;
        }
       
        throw new RiotException("Unrecognized Locator: "+Utils.className(oldloc)) ;
    }
View Full Code Here

TOP

Related Classes of org.apache.jena.riot.RiotException

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.