private Reader getReader(final XMLInputSource inputSource) { final Reader reader = inputSource.getCharacterStream(); if (reader == null) { try { return new InputStreamReader(inputSource.getByteStream(), fJavaEncoding); } catch (final UnsupportedEncodingException e) { // should not happen as this encoding is already used to parse the "main" source } } return reader; }
private Reader getReader(final XMLInputSource inputSource) { Reader reader = inputSource.getCharacterStream(); if (reader == null) { try { return new InputStreamReader(inputSource.getByteStream(), fJavaEncoding); } catch (final UnsupportedEncodingException e) { // should not happen as this encoding is already used to parse the "main" source } } return reader; }
private Reader getReader(final XMLInputSource inputSource) { Reader reader = inputSource.getCharacterStream(); if (reader == null) { try { return new InputStreamReader(inputSource.getByteStream(), fJavaEncoding); } catch (final UnsupportedEncodingException e) { // should not happen as this encoding is already used to parse the "main" source } } return reader; }
private Reader getReader(final XMLInputSource inputSource) { Reader reader = inputSource.getCharacterStream(); if (reader == null) { try { return new InputStreamReader(inputSource.getByteStream(), fJavaEncoding); } catch (final UnsupportedEncodingException e) { // should not happen as this encoding is already used to parse the // "main" source } } return reader; } } // class HTMLScanner
private Reader getReader(final XMLInputSource inputSource) { Reader reader = inputSource.getCharacterStream(); if (reader == null) { try { return new InputStreamReader(inputSource.getByteStream(), fJavaEncoding); } catch (final UnsupportedEncodingException e) { // should not happen as this encoding is already used to parse the // "main" source } } return reader; } } // class HTMLScanner
/** * Sets the input source for the document to parse. * * @param inputSource The document's input source. * @throws XMLConfigurationException Thrown if there is a configuration error when * initializing the parser. * @throws IOException Thrown on I/O error. * @see #parse(boolean) */ public void setInputSource(XMLInputSource inputSource) throws XMLConfigurationException, IOException { reset(); fCloseStream = inputSource.getByteStream() == null && inputSource.getCharacterStream() == null; fDocumentScanner.setInputSource(inputSource); } // setInputSource(XMLInputSource)
/** * Sets the input source for the document to parse. * * @param inputSource The document's input source. * @throws XMLConfigurationException Thrown if there is a configuration error when * initializing the parser. * @throws IOException Thrown on I/O error. * @see #parse(boolean) */ public void setInputSource(XMLInputSource inputSource) throws XMLConfigurationException, IOException { reset(); fCloseStream = inputSource.getByteStream() == null && inputSource.getCharacterStream() == null; fDocumentScanner.setInputSource(inputSource); } // setInputSource(XMLInputSource)
/** * Sets the input source for the document to parse. * * @param inputSource The document's input source. * * @exception XMLConfigurationException Thrown if there is a * configuration error when initializing the * parser. * @exception IOException Thrown on I/O error. * * @see #parse(boolean) */ public void setInputSource(XMLInputSource inputSource) throws XMLConfigurationException, IOException { reset(); fCloseStream = inputSource.getByteStream() == null && inputSource.getCharacterStream() == null; fDocumentScanner.setInputSource(inputSource); } // setInputSource(XMLInputSource)
/** * Sets the input source for the document to parse. * * @param inputSource The document's input source. * * @exception XMLConfigurationException Thrown if there is a * configuration error when initializing the * parser. * @exception IOException Thrown on I/O error. * * @see #parse(boolean) */ public void setInputSource(XMLInputSource inputSource) throws XMLConfigurationException, IOException { reset(); fCloseStream = inputSource.getByteStream() == null && inputSource.getCharacterStream() == null; fDocumentScanner.setInputSource(inputSource); } // setInputSource(XMLInputSource)
/** * Sets the input source for the document to parse. * * @param inputSource The document's input source. * * @exception XMLConfigurationException Thrown if there is a * configuration error when initializing the * parser. * @exception IOException Thrown on I/O error. * * @see #parse(boolean) */ @Override public void setInputSource(XMLInputSource inputSource) throws XMLConfigurationException, IOException { reset(); fCloseStream = inputSource.getByteStream() == null && inputSource.getCharacterStream() == null; fDocumentScanner.setInputSource(inputSource); }
if (source.getCharacterStream() != null) { return source.getCharacterStream();
@Override public void resolve(Identifier id, Input input) throws IOException, ResolverException { if(fResolver != null) { String expanded = id.getUriReference(); //Compute the expanded system ID try { expanded = new URL(new URL(id.getBase()), id.getUriReference()).toString(); } catch (Exception e) { } XMLResourceIdentifier identifier = new XMLResourceIdentifierImpl( null, id.getUriReference(), id.getBase(), expanded); XMLInputSource resolved = fResolver.resolveEntity(identifier); if(resolved != null) { input.setUri(resolved.getSystemId()); input.setByteStream(resolved.getByteStream()); input.setCharacterStream(resolved.getCharacterStream()); input.setEncoding(resolved.getEncoding()); } else { //Just set the URI //input.setUri(expanded); } } } /**
Reader reader = xmlInputSource.getCharacterStream();
Reader reader = source.getCharacterStream(); if (reader == null) { InputStream inputStream = source.getByteStream();
Reader reader = source.getCharacterStream(); if (reader == null) { InputStream inputStream = source.getByteStream();
Reader reader = source.getCharacterStream(); if (reader == null) { InputStream inputStream = source.getByteStream();
Reader reader = source.getCharacterStream(); if (reader == null) { InputStream inputStream = source.getByteStream();
Reader reader = source.getCharacterStream(); if (reader == null) { InputStream inputStream = source.getByteStream();
(schemaSource.getSystemId() != null || schemaSource.getByteStream() != null || schemaSource.getCharacterStream() != null)) {
public LSInput resolveResource(String type,String ns, String publicId, String systemId, String baseUri) { if(fEntityResolver==null) return null; try { XMLInputSource is = fEntityResolver.resolveEntity( new XMLResourceIdentifierImpl(publicId,systemId,baseUri,null)); if(is==null) return null; LSInput di = new DOMInputImpl(); di.setBaseURI(is.getBaseSystemId()); di.setByteStream(is.getByteStream()); di.setCharacterStream(is.getCharacterStream()); di.setEncoding(is.getEncoding()); di.setPublicId(is.getPublicId()); di.setSystemId(is.getSystemId()); return di; } catch( IOException e ) { // erors thrown by the callback is not supposed to be // reported to users. throw new XNIException(e); } } });