public static XMLStreamReader getXMLStreamReader(Source source) {
        if (source instanceof StAXSource) {
            return ((StAXSource) source).getXMLStreamReader();
        } else if (source instanceof StaxSource) {
            return ((StaxSource) source).getXMLStreamReader();
        } else {
            throw new IllegalArgumentException("Source '" + source + "' is neither StaxSource nor StAXSource");
        }
    }
public static XMLStreamReader getXMLStreamReader(Source source) {
        if (source instanceof StAXSource) {
            return ((StAXSource) source).getXMLStreamReader();
        } else if (source instanceof StaxSource) {
            return ((StaxSource) source).getXMLStreamReader();
        } else {
            throw new IllegalArgumentException("Source '" + source + "' is neither StaxSource nor StAXSource");
        }
    }
public static XMLStreamReader getXMLStreamReader ( Source source ) { if ( source instanceof StAXSource ) { return ( ( StAXSource ) source ) . getXMLStreamReader ( ) ; } else if ( source instanceof StaxSource ) { return ( ( StaxSource ) source ) . getXMLStreamReader ( ) ; } else { throw new IllegalArgumentException ( "Source '" + source + "' is neither StaxSource nor StAXSource" ) ; } }
Return the {@link javax.xml.stream.XMLStreamReader} for the given StAX Source.

@param source a JAXP 1.4 {@link javax.xml.transform.stax.StAXSource}
@return the {@link javax.xml.stream.XMLStreamReader}
@throws IllegalArgumentException if {@code source} isn't a JAXP 1.4 {@link javax.xml.transform.stax.StAXSource}
or custom StAX Source
Return the { @link javax . xml . stream . XMLStreamReader } for the given StAX Source .