本文整理汇总了Java中crawlercommons.sitemaps.UnknownFormatException类的典型用法代码示例。如果您正苦于以下问题:Java UnknownFormatException类的具体用法?Java UnknownFormatException怎么用?Java UnknownFormatException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnknownFormatException类属于crawlercommons.sitemaps包,在下文中一共展示了UnknownFormatException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startRootElement
import crawlercommons.sitemaps.UnknownFormatException; //导入依赖的package包/类
private void startRootElement(String uri, String localName, String qName, Attributes attributes) {
elementStack.push(localName);
if ("feed".equals(localName)) {
delegate = new AtomHandler(url, elementStack, strict);
}
// See if it is a RSS feed by looking for the localName "channel"
// element .
// This avoids the issue
// of having the outer tag named <rdf:RDF> that was causing this code to
// fail. Inside of
// the <rss> or <rdf> tag is a <channel> tag, so we can use that.
// See https://github.com/crawler-commons/crawler-commons/issues/87
// and also RSS 1.0 specification http://web.resource.org/rss/1.0/spec
else if ("channel".equals(localName)) {
delegate = new RSSHandler(url, elementStack, strict);
} else if (isStrictNamespace() && !Namespace.SITEMAP.equals(uri)) {
setException(new UnknownFormatException("Namespace " + uri + " does not match standard namespace " + Namespace.SITEMAP));
return;
} else if ("sitemapindex".equals(localName)) {
delegate = new XMLIndexHandler(url, elementStack, strict);
} else if ("urlset".equals(localName)) {
delegate = new XMLHandler(url, elementStack, strict);
}
if (delegate != null) {
// configure delegate
delegate.setStrictNamespace(isStrictNamespace());
}
}
示例2: setException
import crawlercommons.sitemaps.UnknownFormatException; //导入依赖的package包/类
protected void setException(UnknownFormatException exception) {
this.exception = exception;
}
示例3: getException
import crawlercommons.sitemaps.UnknownFormatException; //导入依赖的package包/类
public UnknownFormatException getException() {
return exception;
}