Java 8 ContentHandler - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 ContentHandler class.

This code example shows how to use the following methods:getContent
 
    private static DocumentInfo loadDocument(ContentHandler handler, Uri uri) throws IOException {
        String spec = uri.toString();
        URL url = new URL(spec);
        URLConnection connection = url.openConnection();
        Object content = handler.getContent(connection);
        if (content instanceof DocumentInfo) {
            return (DocumentInfo) content;
        } else { 
            String message = "ContentHandler must return FeedLoader.documentInfo(...)";
            throw new RuntimeException(message);
        } 
    } 
 
    /** 
     * Loads a feed that is contained in a single document. 
     * 
     * @param handler a {@link ContentHandler} that parses a document and 
     *            returns {@link FeedLoader#documentInfo()} or 
     *            {@link FeedLoader#documentInfo(int)}. The feed data is 
3
CodeRank
This code example shows how to use the following methods:getContent
                stack = new Stack<Frame>();
                mFileResponseCache.mStack.set(stack);
            } 
            stack.push(frame);
            try { 
                Object content = mContentHandler.getContent(connection);
                frame.close();
                return content;
            } catch (IOException e) {
                frame.abort();
                throw e;
            } catch (RuntimeException e) {
                frame.abort();
                throw e;
            } catch (Error e) {
                frame.abort();
                throw e;
            } finally { 
                stack.pop();
            } 
3
CodeRank
This code example shows how to use the following methods:getContent
                stack = new Stack<Frame>();
                mFileResponseCache.mStack.set(stack);
            } 
            stack.push(frame);
            try { 
                Object content = mContentHandler.getContent(connection);
                frame.close();
                return content;
            } catch (IOException e) {
                frame.abort();
                throw e;
            } catch (RuntimeException e) {
                frame.abort();
                throw e;
            } catch (Error e) {
                frame.abort();
                throw e;
            } finally { 
                stack.pop();
            } 
3
CodeRank
This code example shows how to use the following methods:getContent
 
    @SuppressWarnings("unchecked") 
    private static <T> T getContent(ContentHandler handler, URLConnection connection) throws IOException {
        HttpURLConnection http = (HttpURLConnection) connection;
        try { 
            return (T) handler.getContent(http);
        } finally { 
            http.disconnect();
        } 
    } 
     
    private static <T> T getContent(ContentHandler handler, URL url) throws IOException {
        return getContent(handler, url.openConnection());
    } 
 
    private TestResponseCache mResponseCache;
     
    @Override 
    protected void setUp() throws Exception { 
        super.setUp(); 
4
CodeRank
This code example shows how to use the following methods:getContent
 
    private static DocumentInfo loadDocument(ContentHandler handler, Uri uri) throws IOException {
        String spec = uri.toString();
        URL url = new URL(spec);
        URLConnection connection = url.openConnection();
        Object content = handler.getContent(connection);
        if (content instanceof DocumentInfo) {
            return (DocumentInfo) content;
        } else { 
            String message = "ContentHandler must return FeedLoader.documentInfo(...)";
            throw new RuntimeException(message);
        } 
    } 
 
    /** 
     * Loads a feed that is contained in a single document. 
     * 
     * @param handler a {@link ContentHandler} that parses a document and 
     *            returns {@link FeedLoader#documentInfo()} or 
     *            {@link FeedLoader#documentInfo(int)}. The feed data is 
4
CodeRank
See Code Examples for Java 8 ContentHandler Methods: