/**
* Report an ignored element via the {@link XMLReporter} if available and the class
* {@link org.apache.commons.logging.Log}.
*
* @param reader The {@link XMLStreamReader} providing the SCXML document to parse.
* @param configuration The {@link Configuration} to use while parsing.
* @param parent The parent element local name in the SCXML namespace.
* @param nsURI The namespace URI of the ignored element.
* @param name The local name of the ignored element.
*
* @throws XMLStreamException An exception processing the underlying {@link XMLStreamReader}.
* @throws ModelException The Commons SCXML object model is incomplete or inconsistent (includes
* errors in the SCXML document that may not be identified by the schema).
*/
private static void reportIgnoredElement(final XMLStreamReader reader, final Configuration configuration,
final String parent, final String nsURI, final String name)
throws XMLStreamException, ModelException {
StringBuilder sb = new StringBuilder();
sb.append("Ignoring unknown or invalid element <").append(name)
.append("> in namespace \"").append(nsURI)
.append("\" as child of <").append(parent)
.append("> at ").append(reader.getLocation());
if (!configuration.isSilent() && logger.isWarnEnabled()) {
logger.warn(sb.toString());
}
if (configuration.isStrict()) {
throw new ModelException(sb.toString());
}
XMLReporter reporter = configuration.reporter;
if (reporter != null) {
reporter.report(sb.toString(), "COMMONS_SCXML", null, reader.getLocation());
}
skipToEndElement(reader);
}
SCXMLReader.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:commons-scxml
作者:
评论列表
文章目录