本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
}