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


Java Link.setType方法代码示例

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


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

示例1: clone

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
@Override
public Object clone() {
    final AtomLinkModuleImpl m = new AtomLinkModuleImpl();
    List<Link> result = new LinkedList<Link>();
    for(Link link : this.getLinks()) {
        Link l = new Link();
        l.setHref(link.getHref());
        l.setType(link.getType());
        l.setRel(link.getRel());
        l.setHreflang(link.getHreflang());
        l.setTitle(link.getTitle());
        l.setLength(link.getLength());
        result.add(l);
    }
    links.subList(0, links.size());
    m.setLinks(result);
    return m;
}
 
开发者ID:rometools,项目名称:rome,代码行数:19,代码来源:AtomLinkModuleImpl.java

示例2: parseLink

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

        final Link link = new Link();

        final String rel = getAttributeValue(eLink, "rel");
        if (rel != null) {
            link.setRel(rel);
        }

        final String type = getAttributeValue(eLink, "type");
        if (type != null) {
            link.setType(type);
        }

        final String href = getAttributeValue(eLink, "href");
        if (href != null) {
            link.setHref(href);
        }

        return link;

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

示例3: buildFeedEntries

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
@Override
protected List<Entry> buildFeedEntries(Map<String, Object> model,
		HttpServletRequest req, HttpServletResponse response) throws Exception {
	// get data model which is passed by the Spring container
	  List<HrmsNews> news = (List<HrmsNews>) model.get("allNews");
       List<Entry> entries = new ArrayList<Entry>(news.size());
		
		for(HrmsNews topic : news ){
		
			Entry entry = new Entry();
			
			
			entry.setId(topic.getId()+"");
						
			entry.setTitle(topic.getDescription());
			
			Content summary = new Content();
			summary.setValue(topic.getSummary());
		    entry.setSummary(summary);
		       
		    Link link = new Link();
		    link.setType("text/html");
		    link.setHref(topic.getLink()); //because I have a different controller to show news at http://yourfanstasticsiteUrl.com/news/ID
		    List arrLinks = new ArrayList();
		    arrLinks.add(link);
		    entry.setAlternateLinks(arrLinks);
		    entry.setUpdated(new Date());
			
		    entries.add(entry);
		}
		
		return entries;
}
 
开发者ID:PacktPublishing,项目名称:Spring-MVC-Blueprints,代码行数:34,代码来源:HrmsAtomViewBuilder.java

示例4: toLink

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
private Link toLink(OPDSLink opdsLinkI) {
    Link link = new Link();
    link.setHref(opdsLinkI.getHref());
    link.setRel(opdsLinkI.getRel());
    link.setType(opdsLinkI.getType());
    return link;
}
 
开发者ID:patexoid,项目名称:ZombieLib2,代码行数:8,代码来源:OpdsView.java

示例5: copyFrom

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
@Override
public void copyFrom(CopyFrom obj) {
    AtomLinkModule other = (AtomLinkModule) obj;
    List<Link> links = other.getLinks();
    for (Link link : links) {
        Link l = new Link();
        l.setHref(link.getHref());
        l.setType(link.getType());
        l.setRel(link.getRel());
        l.setHreflang(link.getHreflang());
        l.setTitle(link.getTitle());
        l.setLength(link.getLength());
        this.links.add(l);
    }
}
 
开发者ID:rometools,项目名称:rome,代码行数:16,代码来源:AtomLinkModuleImpl.java

示例6: parseLink

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

        final Link link = new Link();

        final String rel = getAttributeValue(eLink, AtomLinkAttribute.REL);
        if (rel != null) {
            link.setRel(rel);
        }

        final String type = getAttributeValue(eLink, AtomLinkAttribute.TYPE);
        if (type != null) {
            link.setType(type);
        }

        final String href = getAttributeValue(eLink, AtomLinkAttribute.HREF);
        if (href != null) {
            link.setHref(href);
        }

        final String title = getAttributeValue(eLink, AtomLinkAttribute.TITLE);
        if (title != null) {
            link.setTitle(title);
        }

        final String hrefLang = getAttributeValue(eLink, AtomLinkAttribute.HREF_LANG);
        if (hrefLang != null) {
            link.setHreflang(hrefLang);
        }

        final String length = getAttributeValue(eLink, AtomLinkAttribute.LENGTH);
        if (length != null) {
            final Long val = NumberParser.parseLong(length);
            if (val != null) {
                link.setLength(val.longValue());
            }
        }

        return link;

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

示例7: createAtomEnclosure

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
public Link createAtomEnclosure(final SyndEnclosure syndEnclosure) {
    final Link link = new Link();
    link.setRel("enclosure");
    link.setType(syndEnclosure.getType());
    link.setHref(syndEnclosure.getUrl());
    link.setLength(syndEnclosure.getLength());
    return link;
}
 
开发者ID:rometools,项目名称:rome,代码行数:9,代码来源:ConverterForAtom10.java

示例8: createAtomLink

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
public Link createAtomLink(final SyndLink syndLink) {
    final Link link = new Link();
    link.setRel(syndLink.getRel());
    link.setType(syndLink.getType());
    link.setHref(syndLink.getHref());
    link.setHreflang(syndLink.getHreflang());
    link.setLength(syndLink.getLength());
    link.setTitle(syndLink.getTitle());
    return link;
}
 
开发者ID:rometools,项目名称:rome,代码行数:11,代码来源:ConverterForAtom10.java

示例9: createAtomLink

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
public Link createAtomLink(final SyndLink syndLink) {
    final Link link = new Link();
    link.setRel(syndLink.getRel());
    link.setType(syndLink.getType());
    link.setHref(syndLink.getHref());
    link.setTitle(syndLink.getTitle());
    return link;
}
 
开发者ID:rometools,项目名称:rome,代码行数:9,代码来源:ConverterForAtom03.java

示例10: copyFrom

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
@Override
public void copyFrom(CopyFrom obj) {
    AtomLinkModule other = (AtomLinkModule) obj;
    Link link = other.getLink();
    if (link != null) {
        Link l = new Link();
        l.setHref(link.getHref());
        l.setType(link.getType());
        l.setRel(link.getRel());
        l.setHreflang(link.getHreflang());
        l.setTitle(link.getTitle());
        l.setLength(link.getLength());
        setLink(l);
    }
}
 
开发者ID:rometools,项目名称:rome-modules,代码行数:16,代码来源:AtomLinkModuleImpl.java

示例11: clone

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
@Override
public Object clone() {
    final AtomLinkModuleImpl m = new AtomLinkModuleImpl();
    if (link != null) {
        Link l = new Link();
        l.setHref(link.getHref());
        l.setType(link.getType());
        l.setRel(link.getRel());
        l.setHreflang(link.getHreflang());
        l.setTitle(link.getTitle());
        l.setLength(link.getLength());
        m.setLink(l);
    }
    return m;
}
 
开发者ID:rometools,项目名称:rome-modules,代码行数:16,代码来源:AtomLinkModuleImpl.java

示例12: parseLink

import com.rometools.rome.feed.atom.Link; //导入方法依赖的package包/类
private static Link parseLink(final Element e, final URL baseURI) {

        final Link link = new Link();

        String att = e.getAttributeValue("rel");// getAtomNamespace()); DONT
        // KNOW WHY DOESN'T WORK

        if (att != null) {
            link.setRel(att);
        }

        att = e.getAttributeValue("type");// getAtomNamespace()); DONT KNOW WHY
        // DOESN'T WORK

        if (att != null) {
            link.setType(att);
        }

        att = e.getAttributeValue("href");// getAtomNamespace()); DONT KNOW WHY
        // DOESN'T WORK

        if (att != null) {

            if (isRelativeURI(att)) { //
                link.setHref(resolveURI(baseURI, e, ""));
            } else {
                link.setHref(att);
            }
        }

        att = e.getAttributeValue("hreflang");// getAtomNamespace()); DONT KNOW
        // WHY DOESN'T WORK

        if (att != null) {
            link.setHreflang(att);
        }

        att = e.getAttributeValue("length");// getAtomNamespace()); DONT KNOW
        // WHY DOESN'T WORK

        return link;
    }
 
开发者ID:rometools,项目名称:rome,代码行数:43,代码来源:OpenSearchModuleParser.java

示例13: parseLink

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

        final Link link = new Link();

        final String rel = getAttributeValue(eLink, "rel");
        if (rel != null) {
            link.setRel(rel);
        }

        final String type = getAttributeValue(eLink, "type");
        if (type != null) {
            link.setType(type);
        }

        final String href = getAttributeValue(eLink, "href");
        if (href != null) {
            link.setHref(href);
            if (isRelativeURI(href)) {
                link.setHrefResolved(resolveURI(baseURI, eLink, href));
            }
        }

        final String title = getAttributeValue(eLink, "title");
        if (title != null) {
            link.setTitle(title);
        }

        final String hrefLang = getAttributeValue(eLink, "hreflang");
        if (hrefLang != null) {
            link.setHreflang(hrefLang);
        }

        final String length = getAttributeValue(eLink, "length");
        if (length != null) {
            final Long val = NumberParser.parseLong(length);
            if (val != null) {
                link.setLength(val.longValue());
            }
        }

        return link;

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


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