- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.xerces.impl.XMLErrorReporter
类的一些代码示例,展示了XMLErrorReporter
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLErrorReporter
类的具体详情如下:
包路径:org.apache.xerces.impl.XMLErrorReporter
类名称:XMLErrorReporter
[英]This class is a common element of all parser configurations and is used to report errors that occur. This component can be queried by parser components from the component manager using the following property ID:
http://apache.org/xml/properties/internal/error-reporter
Errors are separated into domains that categorize a class of errors. In a parser configuration, the parser would register a MessageFormatter
for each domain that is capable of localizing error messages and formatting them based on information about the error. Any parser component can invent new error domains and register additional message formatters to localize messages in those domains.
This component requires the following features and properties from the component manager that uses it:
This component can use the following features and properties but they are not required:
http://apache.org/xml/properties/internal/error-reporter
错误被划分为对一类错误进行分类的域。在解析器配置中,解析器将为每个能够本地化错误消息并基于错误信息对其进行格式化的域注册MessageFormatter
。任何解析器组件都可以创建新的错误域,并注册额外的消息格式化程序来本地化这些域中的消息。
此组件需要使用它的组件管理器提供以下功能和属性:
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
/**
* Reports XPointer Warnings
*
*/
private void reportWarning(String key, Object[] arguments)
throws XNIException {
fXPointerErrorReporter.reportError(
XPointerMessageFormatter.XPOINTER_DOMAIN, key, arguments,
XMLErrorReporter.SEVERITY_WARNING);
}
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
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);
}
}
}
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
/**
* 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)
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
/** Create a new ASCII reader from the InputStream. **/
private Reader createASCIIReader(InputStream stream) {
return new ASCIIReader(stream,
fTempString.ch.length,
fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN),
fErrorReporter.getLocale());
}
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
/**
* Initializes error handling objects
*/
protected void initErrorReporter() {
if (fErrorReporter == null) {
fErrorReporter = new XMLErrorReporter();
}
if (fErrorHandler == null) {
fErrorHandler = new XPointerErrorHandler();
}
fErrorReporter.putMessageFormatter(
XPointerMessageFormatter.XPOINTER_DOMAIN,
new XPointerMessageFormatter());
}
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
addComponent(fEntityManager);
fErrorReporter = new XMLErrorReporter();
fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
fProperties.put(ERROR_REPORTER, fErrorReporter);
addComponent(fErrorReporter);
if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
XMLMessageFormatter xmft = new XMLMessageFormatter();
fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
XSMessageFormatter xmft = new XSMessageFormatter();
fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, xmft);
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
XMLDTDLoader(SymbolTable symbolTable,
XMLGrammarPool grammarPool, XMLErrorReporter errorReporter,
XMLEntityResolver entityResolver) {
fSymbolTable = symbolTable;
fGrammarPool = grammarPool;
if(errorReporter == null) {
errorReporter = new XMLErrorReporter();
errorReporter.setProperty(ERROR_HANDLER, new DefaultErrorHandler());
}
fErrorReporter = errorReporter;
// Add XML message formatter if there isn't one.
if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
XMLMessageFormatter xmft = new XMLMessageFormatter();
fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
}
fEntityResolver = entityResolver;
if(fEntityResolver instanceof XMLEntityManager) {
fEntityManager = (XMLEntityManager)fEntityResolver;
} else {
fEntityManager = new XMLEntityManager();
}
fEntityManager.setProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY, errorReporter);
fDTDScanner = createDTDScanner(fSymbolTable, fErrorReporter, fEntityManager);
fDTDScanner.setDTDHandler(this);
fDTDScanner.setDTDContentModelHandler(this);
reset();
} // init(SymbolTable, XMLGrammarPool, XMLErrorReporter, XMLEntityResolver)
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter());
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
fProperties.put(ERROR_REPORTER, fErrorReporter);
addComponent(fErrorReporter);
if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
XMLMessageFormatter xmft = new XMLMessageFormatter();
fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
/** Setup for validation. **/
final void setup(Location location, StAXResult result, boolean stringsInternalized) {
fDepth = 0;
fComponentManager.reset();
setupStAXResultHandler(result);
fValidationManager.setEntityState(this);
if (fEntities != null && !fEntities.isEmpty()) {
// should only clear this if the last document contained unparsed entities
fEntities.clear();
}
fStAXLocationWrapper.setLocation(location);
fErrorReporter.setDocumentLocator(fStAXLocationWrapper);
fStringsInternalized = stringsInternalized;
}
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
Locale locale = (fErrorReporter != null) ? fErrorReporter.getLocale() : null;
String reason = fXIncludeMessageFormatter.formatMessage(locale, "XPointerStreamability", null);
reportResourceError("XMLResourceError", new Object[] { href, reason });
fErrorReporter.setDocumentLocator(fDocLocation);
Locale locale = (fErrorReporter != null) ? fErrorReporter.getLocale() : null;
String reason = fXIncludeMessageFormatter.formatMessage(locale, "XPointerResolutionUnsuccessful", null);
reportResourceError("XMLResourceError", new Object[] {href, reason});
fErrorReporter.setDocumentLocator(fDocLocation);
fErrorReporter.setDocumentLocator(fDocLocation);
fErrorReporter.reportError(ex.getDomain(), ex.getKey(),
ex.getArguments(), XMLErrorReporter.SEVERITY_FATAL_ERROR, ex);
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"CharConversionFailure", null, XMLErrorReporter.SEVERITY_FATAL_ERROR, e);
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
"schema_reference.4",
new Object[] { loc }, XMLErrorReporter.SEVERITY_ERROR);
fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
"schema_reference.4", new Object[] { file.toString() },
XMLErrorReporter.SEVERITY_ERROR);
MessageFormatter mf = fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN);
throw new XMLConfigurationException(
XMLConfigurationException.NOT_SUPPORTED,
mf.formatMessage(fErrorReporter.getLocale(), "jaxp12-schema-source-type.1",
new Object [] {val != null ? val.getClass().getName() : "null"}));
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
fErrorReporter = new XMLErrorReporter();
setProperty(ERROR_REPORTER, fErrorReporter);
addComponent(fErrorReporter);
if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
XMLMessageFormatter xmft = new XMLMessageFormatter();
fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
if (fErrorReporter.getMessageFormatter("http://www.w3.org/TR/xml-schema-1") == null) {
MessageFormatter xmft = null;
try {
fErrorReporter.putMessageFormatter("http://www.w3.org/TR/xml-schema-1", xmft);
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
fErrorReporter = (XMLErrorReporter)value;
if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
XMLMessageFormatter xmft = new XMLMessageFormatter();
fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
fErrorReporter.setProperty(propertyId, value);
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
(XMLErrorReporter) componentManager.getProperty(ERROR_REPORTER);
try {
XMLErrorHandler currErrorHandler = fErrorReporter.getErrorHandler();
Locale currentLocale = fErrorReporter.getLocale();
if (currentLocale != fSchemaParser.getProperty(LOCALE)) {
fSchemaParser.setProperty(LOCALE, currentLocale);
fSchemaParser.setFeature(
CONTINUE_AFTER_FATAL_ERROR,
fErrorReporter.getFeature(CONTINUE_AFTER_FATAL_ERROR));
} catch (XMLConfigurationException e) {
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
/** Returns the registered error handler. */
public XMLErrorHandler getErrorHandler() {
return fErrorReporter.getErrorHandler();
} // getErrorHandler(): XMLErrorHandler
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
private void createAnnotationValidator() {
fAnnotationValidator = new XML11Configuration();
fGrammarBucketAdapter = new XSAnnotationGrammarPool(fSchemaVersion);
fAnnotationValidator.setFeature(VALIDATION, true);
fAnnotationValidator.setFeature(XMLSCHEMA_VALIDATION, true);
fAnnotationValidator.setProperty(XMLGRAMMAR_POOL, fGrammarBucketAdapter);
/** Set error handler. **/
XMLErrorHandler errorHandler = fErrorReporter.getErrorHandler();
fAnnotationValidator.setProperty(ERROR_HANDLER, (errorHandler != null) ? errorHandler : new DefaultErrorHandler());
/** Set locale. **/
Locale locale = fErrorReporter.getLocale();
fAnnotationValidator.setProperty(LOCALE, locale);
}
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
/** Calls reset on each of the components owned by this component manager. **/
public void reset() throws XNIException {
fNamespaceContext.reset();
fValidationManager.reset();
fEntityManager.reset(this);
fErrorReporter.reset(this);
fSchemaValidator.reset(this);
// Mark configuration as fixed.
fConfigUpdated = false;
}
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
/** Creates an error reporter. */
protected XMLErrorReporter createErrorReporter() {
return new XMLErrorReporter();
} // createErrorReporter():XMLErrorReporter
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
MessageFormatter messageFormatter = getMessageFormatter(domain);
String message;
if (messageFormatter != null) {
本文整理了Java中org.apache.xerces.impl.XMLErrorReporter.setDocumentLocator()方法的一些代码示例,展示了XMLErrorReporter.
本文整理了Java中org.apache.xerces.impl.XMLErrorReporter.setLocale()方法的一些代码示例,展示了XMLErrorReporter.setLocale
本文整理了Java中org.apache.xerces.impl.XMLErrorReporter.reset()方法的一些代码示例,展示了XMLErrorReporter.reset()的具体用法。
本文整理了Java中org.apache.xerces.impl.XMLErrorReporter.reportError()方法的一些代码示例,展示了XMLErrorReporter.reportE
我是一名优秀的程序员,十分优秀!