/** * This method notifies of the start of an entity. The document entity * has the pseudo-name of "[xml]" the DTD has the pseudo-name of "[dtd]" * parameter entity names start with '%'; and general entities are just * specified by their name. * * @param name The name of the entity. * @param identifier The resource identifier. * @param encoding The auto-detected IANA encoding name of the entity * stream. This value will be null in those situations * where the entity encoding is not auto-detected (e.g. * internal entities or a document entity that is * parsed from a java.io.Reader). * @param augs Additional information that may include infoset augmentations * * @throws XNIException Thrown by handler to signal an error. */ public void startEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) throws XNIException { // keep track of the entity depth fEntityDepth++; // must reset entity scanner fEntityScanner = fEntityManager.getEntityScanner(); } // startEntity(String,XMLResourceIdentifier,String)
/** * Scans a document. * * @param complete True if the scanner should scan the document * completely, pushing all events to the registered * document handler. A value of false indicates that * that the scanner should only scan the next portion * of the document and return. A scanner instance is * permitted to completely scan a document if it does * not support this "pull" scanning model. * * @return True if there is more to scan, false otherwise. */ public boolean scanDocument(boolean complete) throws IOException, XNIException { // reset entity scanner fEntityScanner = fEntityManager.getEntityScanner(); // keep dispatching "events" fEntityManager.setEntityHandler(this); do { if (!fDispatcher.dispatch(complete)) { return false; } } while (complete); // return success return true; } // scanDocument(boolean):boolean
protected void reset() { super.reset(); fDTDScanner.reset(); fEntityManager.reset(); fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner()); }
fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner()); fProperties.put(ERROR_REPORTER, fErrorReporter); addCommonComponent(fErrorReporter);
fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner()); fProperties.put(ERROR_REPORTER, fErrorReporter); addCommonComponent(fErrorReporter);
fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner()); fProperties.put(ERROR_REPORTER, fErrorReporter); addCommonComponent(fErrorReporter);
fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner()); fProperties.put(ERROR_REPORTER, fErrorReporter); addComponent(fErrorReporter);
/** * Reset the reference to the appropriate scanner given the version of the * document and start document scanning. * @param scanner - the scanner to use * @param version - the version of the document (XML 1.1 or XML 1.0). */ public void startDocumentParsing(XMLEntityHandler scanner, short version){ if (version == Constants.XML_VERSION_1_0){ fEntityManager.setScannerVersion(Constants.XML_VERSION_1_0); } else { fEntityManager.setScannerVersion(Constants.XML_VERSION_1_1); } // Make sure the locator used by the error reporter is the current entity scanner. fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner()); // Note: above we reset fEntityScanner in the entity manager, thus in startEntity // in each scanner fEntityScanner field must be reset to reflect the change. // fEntityManager.setEntityHandler(scanner); scanner.startEntity(fXMLSymbol, fEntityManager.getCurrentResourceIdentifier(), fEncoding, null); }
fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner()); fProperties.put(ERROR_REPORTER, fErrorReporter); addComponent(fErrorReporter);
throws IOException, XNIException { fEntityScanner = fEntityManager.getEntityScanner(); fEntityManager.setEntityHandler(this); fStandalone = standalone;
XMLEntityScanner scanner = fEntityManager.getEntityScanner(); try { if (!scanner.skipString("<?xml")) {
fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner()); setProperty(ERROR_REPORTER, fErrorReporter); addComponent(fErrorReporter);