Package org.apache.jena.atlas

Examples of org.apache.jena.atlas.AtlasException


   
    /** Compile a mapping */
    static <T> int[] compileMapping(List<T> domain, List<T>range)
    {
        if ( domain.size() != range.size() )
            throw new AtlasException("Bad mapping: lengths not the same: "+domain+" -> "+range) ;
       
        int[] cols = new int[domain.size()] ;
        boolean[] mapped = new boolean[domain.size()] ;
        //Arrays.fill(mapped, false) ;
       
        for ( int i = 0 ; i < domain.size() ; i++ )
        {
            T input = domain.get(i) ;
            int j = range.indexOf(input) ;
            if ( j < 0 )
                throw new AtlasException("Bad mapping: missing mapping: "+domain+" -> "+range) ;
            if ( mapped[j] )
                throw new AtlasException("Bad mapping: duplicate: "+domain+" -> "+range) ;
            cols[i] = j ;
            mapped[j] = true ;
        }
        return cols ;
    }
View Full Code Here


            if ( x == 0 )
                break ;
        }

        if ( x != 0 )
            throw new AtlasException("formatUnsignedLongHex: overflow") ;

        while ( w > 0 )
        {
            b[idx] = '0' ;
            idx-- ;
View Full Code Here

            if ( logging && classLoader != null )
                log.trace("Using system classloader") ;
        }
       
        if ( classLoader == null )
            throw new AtlasException("Failed to find a classloader") ;
        return classLoader ;
    }
View Full Code Here

    public static PeekInputStream open(String filename)
    {
        try {
            InputStream in = new FileInputStream(filename) ;
            return make(in) ;
        } catch (FileNotFoundException ex){ throw new AtlasException("File not found: "+filename) ; }
    }
View Full Code Here

    public static PeekReader open(String filename)
    {
        try {
            InputStream in = new FileInputStream(filename) ;
            return makeUTF8(in) ;
        } catch (FileNotFoundException ex){ throw new AtlasException("File not found: "+filename) ; }
    }
View Full Code Here

                if ( i == off )
                    return -1 ;
                return (i-off) ;
            }
            if ( x > 128 )
                throw new AtlasException("Illegal ASCII character : "+x) ;
            cbuf[i] = (char)x ;
        }
        return len ;
    }
View Full Code Here

        else
            IO.exception(new IOException("Illegal UTF-8: "+x)) ;

        // This test will go off.  We're processing a 4 byte sequence but Java only supports 16 bit chars.
        if ( ch > Character.MAX_VALUE )
            throw new AtlasException("Out of range character (must use a surrogate pair)") ;
        if ( ! Character.isDefined(ch) ) throw new AtlasException(String.format("Undefined codepoint: 0x%04X", ch)) ;
        return ch ;
    }
View Full Code Here

        int x = start ;
        for ( int i = 0 ; i < len-1 ; i++ )
        {
            int x2 = input.advance() ;
            if ( x2 == -1 )
                throw new AtlasException("Premature end to UTF-8 sequence at end of input") ;
           
            if ( (x2 & 0xC0) != 0x80 )
                //throw new AtlasException("Illegal UTF-8 processing character "+count+": "+x2) ;
                throw new AtlasException(String.format("Illegal UTF-8 processing character: 0x%04X",x2)) ;
            // 6 bits of x2
            x = (x << 6) | (x2 & 0x3F);
        }
        return x ;
    }
View Full Code Here

        write$(ch) ;
        column += 1 ;
    }

    private void write$(char ch)
    { try { out.write(ch) ; } catch (IOException ex) { throw new AtlasException(ex) ; } }
View Full Code Here

    private void write$(char ch)
    { try { out.write(ch) ; } catch (IOException ex) { throw new AtlasException(ex) ; } }
   
    private void write$(String s)
    { try { out.write(s) ; } catch (IOException ex) { throw new AtlasException(ex) ; } }
View Full Code Here

TOP

Related Classes of org.apache.jena.atlas.AtlasException

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.