All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fasterxml.aalto.async.AsyncStreamReaderImpl Maven / Gradle / Ivy

There is a newer version: 1.3.3
Show newest version
package com.fasterxml.aalto.async;

import javax.xml.stream.XMLStreamException;

import com.fasterxml.aalto.AsyncInputFeeder;
import com.fasterxml.aalto.AsyncXMLStreamReader;
import com.fasterxml.aalto.stax.StreamReaderImpl;

/**
 * Implementation of {@link AsyncXMLStreamReader}.
 */
public class AsyncStreamReaderImpl
     extends StreamReaderImpl
     implements AsyncXMLStreamReader
{
    protected final AsyncByteScanner _asyncScanner;
    
    public AsyncStreamReaderImpl(AsyncByteScanner scanner)
    {
        super(scanner);
        _asyncScanner = scanner;
        _currToken = EVENT_INCOMPLETE;
    }

    /*
    /**********************************************************************
    /* AsyncXMLStreamReader implementation
    /**********************************************************************
     */
    
    @SuppressWarnings("unchecked")
    @Override
    public F getInputFeeder() {
        return (F) _asyncScanner;
    }

    /*
    /**********************************************************************
    /* Overrides
    /**********************************************************************
     */

    @Override
    protected void _reportNonTextEvent(int type) throws XMLStreamException
    {
        // for Async parser
        if (type == EVENT_INCOMPLETE) {
            throwWfe("Can not use text-aggregating methods with non-blocking parser, as they (may) require blocking");
        }
        super._reportNonTextEvent(type);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy