/** * Get the Xerces version being used. * * @return Xerces version being used */ public static String getXercesVersion() { try { return org.apache.xerces.impl.Version.getVersion(); } catch (java.lang.NoClassDefFoundError ex) { return "Xerces-J 2.2.0"; } }
private int skipInvalidEnumerationValue() throws IOException { int c; do { c = fEntityScanner.scanChar(); } while (c != '|' && c != ')'); ensureEnumerationSize(fEnumerationCount + 1); fEnumeration[fEnumerationCount++] = XMLSymbols.EMPTY_STRING; return c; }
/** Parses the DTD file specified by the given input source. */ public void parse(XMLInputSource source) throws XNIException, IOException { fScanner.reset(this); fEntityManager.reset(this); fErrorReporter.reset(this); fScanner.setInputSource(source); try { fScanner.scanDTDExternalSubset(true); } catch (EOFException e) { // ignore // NOTE: This is to work around a problem in the Xerces // DTD scanner implementation when used standalone. -Ac } } // parse(XMLInputSource)
protected void reset() { super.reset(); fDTDScanner.reset(); fEntityManager.reset(); fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner()); }
private void setErrorReporter(XMLErrorReporter reporter) { fErrorReporter = reporter; if (fErrorReporter != null) { fErrorReporter.putMessageFormatter( XIncludeMessageFormatter.XINCLUDE_DOMAIN, fXIncludeMessageFormatter); // this ensures the proper location is displayed in error messages if (fDocLocation != null) { fErrorReporter.setDocumentLocator(fDocLocation); } } }
/** * Reports XPointer Warnings * */ private void reportWarning(String key, Object[] arguments) throws XNIException { fXPointerErrorReporter.reportError( XPointerMessageFormatter.XPOINTER_DOMAIN, key, arguments, XMLErrorReporter.SEVERITY_WARNING); }
/** * Set the locale to use for messages. * * @param locale The locale object to use for localization of messages. * * @exception XNIException Thrown if the parser does not support the * specified locale. */ public void setLocale(Locale locale) { fLocale = locale; fErrorReporter.setLocale(locale); } // setLocale(Locale)
/** * Sets the error handler. * * @param errorHandler The error handler. */ public void setErrorHandler(XMLErrorHandler errorHandler) { fErrorReporter.setProperty(ERROR_HANDLER, errorHandler); } // setErrorHandler(XMLErrorHandler)
/** * If the application decides to terminate parsing before the xml document * is fully parsed, the application should call this method to free any * resource allocated during parsing. For example, close all opened streams. */ public void cleanup() { fEntityManager.closeReaders(); }
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException { super.reset(componentManager); fPerformValidation = false; fBindNamespaces = false; }
/** Returns the scanner state name. */ protected String getScannerStateName(int state) { switch (state) { case SCANNER_STATE_XML_DECL: return "SCANNER_STATE_XML_DECL"; case SCANNER_STATE_PROLOG: return "SCANNER_STATE_PROLOG"; case SCANNER_STATE_TRAILING_MISC: return "SCANNER_STATE_TRAILING_MISC"; case SCANNER_STATE_DTD_INTERNAL_DECLS: return "SCANNER_STATE_DTD_INTERNAL_DECLS"; case SCANNER_STATE_DTD_EXTERNAL: return "SCANNER_STATE_DTD_EXTERNAL"; case SCANNER_STATE_DTD_EXTERNAL_DECLS: return "SCANNER_STATE_DTD_EXTERNAL_DECLS"; } return super.getScannerStateName(state); } // getScannerStateName(int):String
/** Clears the entity. */ public void clear() { super.clear(); entityLocation = null; notation = null; } // clear()
/** Sets the values of the entity. */ public void setValues(ExternalEntity entity) { super.setValues(entity); entityLocation = entity.entityLocation; notation = entity.notation; } // setValues(ExternalEntity)
public CharacterBufferPool(int poolSize, int externalBufferSize, int internalBufferSize) { fExternalBufferSize = externalBufferSize; fInternalBufferSize = internalBufferSize; fPoolSize = poolSize; init(); }
public void reportError(String domain, String key, Object[] arguments, short severity) throws XNIException { currentErrorKey = key; currentMessageArguments = arguments; super.reportError(domain, key, arguments, severity); } };
/** * Convenience function used in all XML scanners. */ protected void reportFatalError(String msgId, Object[] args) throws XNIException { fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, msgId, args, XMLErrorReporter.SEVERITY_FATAL_ERROR); }