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


Java Link.getLength方法代码示例

本文整理汇总了Java中com.rometools.rome.feed.atom.Link.getLength方法的典型用法代码示例。如果您正苦于以下问题:Java Link.getLength方法的具体用法?Java Link.getLength怎么用?Java Link.getLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.rometools.rome.feed.atom.Link的用法示例。


在下文中一共展示了Link.getLength方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateLink

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
private Element generateLink(Link link) {
    Element linkElement = new Element("link", NS);

    if (link.getHref() != null) {
        Attribute href = new Attribute(AtomLinkAttribute.HREF, link.getHref());
        linkElement.setAttribute(href);
    }
    if (link.getType() != null) {
        Attribute type = new Attribute(AtomLinkAttribute.TYPE, link.getType());
        linkElement.setAttribute(type);
    }
    if (link.getRel() != null) {
        Attribute rel = new Attribute(AtomLinkAttribute.REL, link.getRel());
        linkElement.setAttribute(rel);
    }

    if (link.getHreflang() != null) {
        final Attribute hreflangAttribute = new Attribute(AtomLinkAttribute.HREF_LANG, link.getHreflang());
        linkElement.setAttribute(hreflangAttribute);
    }

    if (link.getTitle() != null) {
        final Attribute title = new Attribute(AtomLinkAttribute.TITLE, link.getTitle());
        linkElement.setAttribute(title);
    }

    if (link.getLength() != 0) {
        final Attribute length = new Attribute(AtomLinkAttribute.LENGTH, Long.toString(link.getLength()));
        linkElement.setAttribute(length);
    }

    return linkElement;
}
 
开发者ID:rometools,项目名称:rome,代码行数:34,代码来源:AtomModuleGenerator.java

示例2: generateLinc

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
private void generateLinc(Link link, Element element) {
    if (link == null) {
        return;
    }

    Element linkElement = new Element("link", NS);

    if (link.getHref() != null) {
        Attribute href = new Attribute(AtomLinkAttribute.HREF, link.getHref());
        linkElement.setAttribute(href);
    }
    if (link.getType() != null) {
        Attribute type = new Attribute(AtomLinkAttribute.TYPE, link.getType());
        linkElement.setAttribute(type);
    }
    if (link.getRel() != null) {
        Attribute rel = new Attribute(AtomLinkAttribute.REL, link.getRel());
        linkElement.setAttribute(rel);
    }

    if (link.getHreflang() != null) {
        final Attribute hreflangAttribute = new Attribute(AtomLinkAttribute.HREF_LANG, link.getHreflang());
        linkElement.setAttribute(hreflangAttribute);
    }

    if (link.getTitle() != null) {
        final Attribute title = new Attribute(AtomLinkAttribute.TITLE, link.getTitle());
        linkElement.setAttribute(title);
    }

    if (link.getLength() != 0) {
        final Attribute lenght = new Attribute(AtomLinkAttribute.LENGTH, Long.toString(link.getLength()));
        linkElement.setAttribute(lenght);
    }

    element.addContent(linkElement);
}
 
开发者ID:rometools,项目名称:rome-modules,代码行数:38,代码来源:AtomModuleGenerator.java

示例3: generateLinkElement

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
private Element generateLinkElement(final Link link) {

        final Namespace namespace = getFeedNamespace();
        final Element linkElement = new Element("link", namespace);

        final String rel = link.getRel();
        if (rel != null) {
            final Attribute relAttribute = new Attribute("rel", rel);
            linkElement.setAttribute(relAttribute);
        }

        final String type = link.getType();
        if (type != null) {
            final Attribute typeAttribute = new Attribute("type", type);
            linkElement.setAttribute(typeAttribute);
        }

        final String href = link.getHref();
        if (href != null) {
            final Attribute hrefAttribute = new Attribute("href", href);
            linkElement.setAttribute(hrefAttribute);
        }

        final String hreflang = link.getHreflang();
        if (hreflang != null) {
            final Attribute hreflangAttribute = new Attribute("hreflang", hreflang);
            linkElement.setAttribute(hreflangAttribute);
        }

        final String linkTitle = link.getTitle();
        if (linkTitle != null) {
            final Attribute title = new Attribute("title", linkTitle);
            linkElement.setAttribute(title);
        }

        if (link.getLength() != 0) {
            final Attribute lenght = new Attribute("length", Long.toString(link.getLength()));
            linkElement.setAttribute(lenght);
        }

        return linkElement;

    }
 
开发者ID:patexoid,项目名称:ZombieLib2,代码行数:44,代码来源:OPDSGenerator.java

示例4: generateLinkElement

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
protected Element generateLinkElement(final Link link) {

        final Namespace namespace = getFeedNamespace();
        final Element linkElement = new Element("link", namespace);

        final String rel = link.getRel();
        if (rel != null) {
            final Attribute relAttribute = new Attribute("rel", rel);
            linkElement.setAttribute(relAttribute);
        }

        final String type = link.getType();
        if (type != null) {
            final Attribute typeAttribute = new Attribute("type", type);
            linkElement.setAttribute(typeAttribute);
        }

        final String href = link.getHref();
        if (href != null) {
            final Attribute hrefAttribute = new Attribute("href", href);
            linkElement.setAttribute(hrefAttribute);
        }

        final String hreflang = link.getHreflang();
        if (hreflang != null) {
            final Attribute hreflangAttribute = new Attribute("hreflang", hreflang);
            linkElement.setAttribute(hreflangAttribute);
        }

        final String linkTitle = link.getTitle();
        if (linkTitle != null) {
            final Attribute title = new Attribute("title", linkTitle);
            linkElement.setAttribute(title);
        }

        if (link.getLength() != 0) {
            final Attribute lenght = new Attribute("length", Long.toString(link.getLength()));
            linkElement.setAttribute(lenght);
        }

        return linkElement;

    }
 
开发者ID:rometools,项目名称:rome,代码行数:44,代码来源:Atom10Generator.java


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