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


Java Link.getRel方法代码示例

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


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

示例1: generateLinkElement

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

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

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

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

    if (link.getHreflang() != null) {
        final Attribute hreflangAttribute = new Attribute("hreflang", link.getHreflang());
        linkElement.setAttribute(hreflangAttribute);
    }
    return linkElement;
}
 
开发者ID:rometools,项目名称:rome,代码行数:25,代码来源:OpenSearchModuleGenerator.java

示例2: generateLinkElement

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

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

        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);
        }

        return linkElement;

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

示例3: 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

示例4: parseAlternateLinks

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
private List<Link> parseAlternateLinks(final Feed feed, final Entry entry, final String baseURI, final List<Element> eLinks) {

        final List<Link> links = new ArrayList<Link>();
        for (final Element eLink : eLinks) {
            final Link link = parseLink(feed, entry, baseURI, eLink);
            if (link.getRel() == null || "".equals(link.getRel().trim()) || "alternate".equals(link.getRel())) {
                links.add(link);
            }
        }

        return Lists.emptyToNull(links);

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

示例5: getMediaLinkURI

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
/**
 * Get media link URI for editing the media resource associated with this entry via HTTP PUT or
 * DELETE.
 */
public String getMediaLinkURI() {
    for (int i = 0; i < getOtherLinks().size(); i++) {
        final Link link = getOtherLinks().get(i);
        if (link.getRel() != null && link.getRel().equals("edit-media")) {
            return link.getHrefResolved();
        }
    }
    return null;
}
 
开发者ID:rometools,项目名称:rome,代码行数:14,代码来源:ClientMediaEntry.java

示例6: getEditURI

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
/**
 * Get the URI that can be used to edit the entry via HTTP PUT or DELETE.
 */
public String getEditURI() {
    for (int i = 0; i < getOtherLinks().size(); i++) {
        final Link link = getOtherLinks().get(i);
        if (link.getRel() != null && link.getRel().equals("edit")) {
            return link.getHrefResolved();
        }
    }
    return null;
}
 
开发者ID:rometools,项目名称:rome,代码行数:13,代码来源:ClientEntry.java

示例7: 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

示例8: 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

示例9: 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

示例10: copyFromRomeEntry

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
void copyFromRomeEntry(final ClientEntry entry) {
    id = entry.getId();
    title = entry.getTitle();
    editURI = entry.getEditURI();
    final List<Link> altlinks = entry.getAlternateLinks();
    if (altlinks != null) {
        for (final Link link : altlinks) {
            if ("alternate".equals(link.getRel()) || link.getRel() == null) {
                permalink = link.getHrefResolved();
                break;
            }
        }
    }
    final List<com.rometools.rome.feed.atom.Content> contents = entry.getContents();
    com.rometools.rome.feed.atom.Content romeContent = null;
    if (contents != null && !contents.isEmpty()) {
        romeContent = contents.get(0);
    }
    if (romeContent != null) {
        content = new BlogEntry.Content(romeContent.getValue());
        content.setType(romeContent.getType());
        content.setSrc(romeContent.getSrc());
    }
    if (entry.getCategories() != null) {
        final List<Category> cats = new ArrayList<Category>();
        final List<com.rometools.rome.feed.atom.Category> romeCats = entry.getCategories();
        for (final com.rometools.rome.feed.atom.Category romeCat : romeCats) {
            final BlogEntry.Category cat = new BlogEntry.Category();
            cat.setId(romeCat.getTerm());
            cat.setUrl(romeCat.getScheme());
            cat.setName(romeCat.getLabel());
            cats.add(cat);
        }
        categories = cats;
    }
    final List<SyndPerson> authors = entry.getAuthors();
    if (authors != null && !authors.isEmpty()) {
        final com.rometools.rome.feed.atom.Person romeAuthor = (com.rometools.rome.feed.atom.Person) authors.get(0);
        if (romeAuthor != null) {
            author = new Person();
            author.setName(romeAuthor.getName());
            author.setEmail(romeAuthor.getEmail());
            author.setUrl(romeAuthor.getUrl());
        }
    }
    publicationDate = entry.getPublished();
    modificationDate = entry.getModified();

    final AppModule control = (AppModule) entry.getModule(AppModule.URI);
    if (control != null && control.getDraft() != null) {
        draft = control.getDraft().booleanValue();
    } else {
        draft = false;
    }
}
 
开发者ID:rometools,项目名称:rome,代码行数:56,代码来源:AtomEntry.java


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