当前位置: 首页>>代码示例>>Java>>正文


Java UnknownFormatException类代码示例

本文整理汇总了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());
    }
}
 
开发者ID:crawler-commons,项目名称:crawler-commons,代码行数:30,代码来源:DelegatorHandler.java

示例2: setException

import crawlercommons.sitemaps.UnknownFormatException; //导入依赖的package包/类
protected void setException(UnknownFormatException exception) {
    this.exception = exception;
}
 
开发者ID:crawler-commons,项目名称:crawler-commons,代码行数:4,代码来源:DelegatorHandler.java

示例3: getException

import crawlercommons.sitemaps.UnknownFormatException; //导入依赖的package包/类
public UnknownFormatException getException() {
    return exception;
}
 
开发者ID:crawler-commons,项目名称:crawler-commons,代码行数:4,代码来源:DelegatorHandler.java


注:本文中的crawlercommons.sitemaps.UnknownFormatException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。