Creates and sets a sole instance of XMLReader which will be used
by this verifier.
194227
protected void prepareXMLReader() throws VerifierConfigurationException {
		try {
			SAXParserFactory factory = SAXParserFactory.newInstance();
			factory.setNamespaceAware(true);
			reader = factory.newSAXParser().getXMLReader();
		} catch( SAXException e ) {
			throw new VerifierConfigurationException(e);
		} catch( ParserConfigurationException pce ) {
			throw new VerifierConfigurationException(pce);
		}
	}
874901
public XmlWrapperParser createParser(Reader reader) {	    
        try {
			return new XmlWrapperParser(this, reader, getSupportedFormat());
		} catch (Exception e) {
			e.printStackTrace();
			throw new KriptonRuntimeException(e);
		}
	}
1169517
public void initialise(XMLReader reader, AbstractGpxParserDefault parent) {
        setReader(reader);
        setParent(parent);
        setContentBuffer(parent.getContentBuffer());
        setWptPreparedStmt(parent.getWptPreparedStmt());
        setElementNames(parent.getElementNames());
        setCurrentPoint(parent.getCurrentPoint());
    }
364202
def readerForMemory(buffer, size, URL, encoding, options):
    
    ret = libxml2mod.xmlReaderForMemory(buffer, size, URL, encoding, options)
    if ret is None:raise treeError('xmlReaderForMemory() failed')
    return xmlTextReader(_obj=ret)
544220
public static Reader createReader(InputStream inputStream,String encoding)
    {
        //get encoding
        String updatedEncoding=IOHelper.getEncodingToUse(encoding);
        
        //create reader
        Reader reader=null;
        try
        {
            reader=new InputStreamReader(inputStream,updatedEncoding);
        }
        catch(UnsupportedEncodingException exception)
        {
            throw new FaxException("Unable to create reader, unsupported encoding: "+encoding,exception);
        }
        
        return reader;
    }
440765
function createReader(noDecode, writerType, readerType) {
  if (noDecode) {
    return (function (skipper) {
      return function (tap) {
        var pos = tap.pos;
        skipper(tap);
        return tap.buf.slice(pos, tap.pos);
      };
    })(writerType._skip);
  } else if (readerType) {
    var resolver = readerType.createResolver(writerType);
    return function (tap) { return resolver._read(tap); };
  } else {
    return function (tap) { return writerType._read(tap); };
  }
}
648460
void initXMLReader(final File ditaDir, final boolean validate) throws SAXException {
        reader = XMLUtils.getXMLReader();
        reader.setFeature(FEATURE_NAMESPACE, true);
        reader.setFeature(FEATURE_NAMESPACE_PREFIX, true);
        if (validate) {
            reader.setFeature(FEATURE_VALIDATION, true);
            try {
                reader.setFeature(FEATURE_VALIDATION_SCHEMA, true);
            } catch (final SAXNotRecognizedException e) {
                // Not Xerces, ignore exception
            }
        } else {
            logger.warn(MessageUtils.getMessage("DOTJ037W").toString());
        }
        if (gramcache) {
            final XMLGrammarPool grammarPool = GrammarPoolManager.getGrammarPool();
            try {
                reader.setProperty("http://apache.org/xml/properties/internal/grammar-pool", grammarPool);
                logger.info("Using Xerces grammar pool for DTD and schema caching.");
            } catch (final NoClassDefFoundError e) {
                logger.debug("Xerces not available, not using grammar caching");
            } catch (final SAXNotRecognizedException | SAXNotSupportedException e) {
                logger.warn("Failed to set Xerces grammar pool for parser: " + e.getMessage());
            }
        }
        CatalogUtils.setDitaDir(ditaDir);
        reader.setEntityResolver(CatalogUtils.getCatalogResolver());
    }
1143999
public static void copy(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
        copy(reader, writer, false, false);
    }
1293250
public synchronized void releaseXMLReader(XMLReader reader) {
        // If the reader that's being released is the cached reader
        // for this thread, remove it from the m_isUse list.
        if (m_readers.get() == reader && reader != null) {
            m_inUse.remove(reader);
        }
    }
617149
@Nonnull
  public static <T> UBLTRReaderBuilder <T> create (@Nonnull final Class <T> aClass)
  {
    return new UBLTRReaderBuilder <> (aClass);
  }
943183
private void init(InputSource is) throws FunctionLibException {

	try {

	    xmlReader = XMLUtil.createXMLReader();
	    xmlReader.setContentHandler(this);
	    xmlReader.setErrorHandler(this);
	    xmlReader.setEntityResolver(new FunctionLibEntityResolver());
	    xmlReader.parse(is);
	}
	catch (IOException e) {

	    throw new FunctionLibException("IO Exception: " + e.getMessage());
	}
	catch (SAXException e) {
	    throw new FunctionLibException("SaxException: " + e.getMessage());
	}

    }
378898
@Override
    public XMLEventReader createXMLEventReader(InputStream in)
        throws XMLStreamException
    {
        // false for auto-close, since caller has access to the input stream
        return new WstxEventReader(createEventAllocator(),
        		createSR(null, in, null, true, false));
    }
710757
public XmlPullParser newPullParser() throws XmlPullParserException {
        final XmlPullParser pp = getParserInstance();
        for (Map.Entry<String, Boolean> entry : features.entrySet()) {
            // NOTE: This test is needed for compatibility reasons. We guarantee
            // that we only set a feature on a parser if its value is true.
            if (entry.getValue()) {
                pp.setFeature(entry.getKey(), entry.getValue());
            }
        }

        return pp;
    }
328270
public static void initReadme() {
        try {
            InputStream readmeStream = JavadocFixTool.class.getResourceAsStream("/README");
            if (readmeStream != null) {
                BufferedReader readmeReader = new BufferedReader(new InputStreamReader(readmeStream));
                StringBuilder readmeBuilder = new StringBuilder();
                String s;
                while ((s = readmeReader.readLine()) != null) {
                    readmeBuilder.append(s);
                    readmeBuilder.append("\n");
                }
                readme = readmeBuilder.toString();
            }
        } catch (IOException ignore) {} // Ignore exception - readme not initialized
    }
689646
public static XMLStreamException missingRequiredElement(final XMLExtendedStreamReader reader, final Set<?> required) {
        final StringBuilder b = new StringBuilder();
        Iterator<?> iterator = required.iterator();
        while (iterator.hasNext()) {
            final Object o = iterator.next();
            b.append(o.toString());
            if (iterator.hasNext()) {
                b.append(", ");
            }
        }
        final XMLStreamException ex = ControllerLogger.ROOT_LOGGER.missingRequiredElements(b, reader.getLocation());

        Set<String> set = new HashSet<>();
        for (Object o : required) {
            String toString = o.toString();
            set.add(toString);
        }
        return new XMLStreamValidationException(ex.getMessage(),
                                                ValidationError.from(ex, ErrorType.REQUIRED_ELEMENTS_MISSING)
                                                        .element(reader.getName())
                                                        .alternatives(set),
                                                ex);
    }
661355
public EventReader createReader() {
        return new EventReader(eventsProcessor, sourceFilter, eventFilter, progressReporter, exceptionHandler, sqsManager, s3Manager, config);
    }
68815
def createReader(clazz, readername):
        
        if not clazz in ReaderFactory.factories:
            ReaderFactory.factories[clazz] = get_class(clazz).Factory()
        return ReaderFactory.factories[clazz].create(readername)