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


Java Feed类代码示例

本文整理汇总了Java中org.jboss.resteasy.plugins.providers.atom.Feed的典型用法代码示例。如果您正苦于以下问题:Java Feed类的具体用法?Java Feed怎么用?Java Feed使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getFeed

import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
@GET
@Produces("application/atom+xml")
public Feed getFeed() throws URISyntaxException {
    Feed feed = new Feed();
    feed.setId(new URI("http://test.com/1"));
    feed.setTitle("WildFly Camel Test Feed");
    feed.setUpdated(new Date());

    Link link = new Link();
    link.setHref(new URI("http://localhost"));
    link.setRel("edit");
    feed.getLinks().add(link);
    feed.getAuthors().add(new Person("WildFly Camel"));

    Entry entry = new Entry();
    entry.setTitle("Hello Kermit");

    Content content = new Content();
    content.setType(MediaType.TEXT_HTML_TYPE);
    content.setText("Greeting Kermit");
    entry.setContent(content);

    feed.getEntries().add(entry);
    return feed;
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:26,代码来源:AtomFeed.java

示例2: queryFullArtifacts

import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
@Override
public List<BaseArtifactType> queryFullArtifacts(String query) throws Exception {
    String path = "/s-ramp?query=" + query;
    List<BaseArtifactType> artifacts = new ArrayList<BaseArtifactType>();
    Feed feed = getFeed(path, 200);
    for (Entry entry : feed.getEntries()) {
        for (Link link : entry.getLinks()) {
            // TODO: Safe assumption for all impls?
            if ("self".equals(link.getRel())) {
                artifacts.add(SrampAtomUtils.unwrapSrampArtifact(getArtifact(link.getHref().toString(), 200)));
            }
        }
    }
    return artifacts;
}
 
开发者ID:ArtificerRepo,项目名称:s-ramp-tck,代码行数:16,代码来源:AtomBinding.java

示例3: storedQuery

import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
@Override
public List<BaseArtifactType> storedQuery(String queryName, String pagingParams, int expectedResponse) throws Exception {
    String path = "/s-ramp/query/" + queryName + "/results?" + pagingParams;
    List<BaseArtifactType> artifacts = new ArrayList<BaseArtifactType>();
    Feed feed = getFeed(path, expectedResponse);
    if (feed != null) {
        for (Entry entry : feed.getEntries()) {
            artifacts.add(SrampAtomUtils.unwrapSrampArtifact(entry));
        }
    }
    return artifacts;
}
 
开发者ID:ArtificerRepo,项目名称:s-ramp-tck,代码行数:13,代码来源:AtomBinding.java

示例4: getFeed

import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
private Feed getFeed(String endpoint, int expectedResponse) {
    Builder clientRequest = getClientRequest(BASE_URL + endpoint);
    Response response = clientRequest.get();
    boolean continueProcessing = verifyResponse(response, expectedResponse);
    if (continueProcessing) {
        Feed feed = response.readEntity(Feed.class);
        verifyFeed(feed);
        return feed;
    } else {
        return null;
    }
}
 
开发者ID:ArtificerRepo,项目名称:s-ramp-tck,代码行数:13,代码来源:AtomBinding.java

示例5: verifyFeed

import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
private void verifyFeed(Feed feed) {
    for (Object key : feed.getExtensionAttributes().keySet()) {
        QName qname = (QName) key;
        // Foundation 1.9
        assertEquals(NAMESPACE, qname.getNamespaceURI());
    }
    for (Entry entry : feed.getEntries()) {
        verifyEntry(entry);
  }
}
 
开发者ID:ArtificerRepo,项目名称:s-ramp-tck,代码行数:11,代码来源:AtomBinding.java

示例6: getFeed

import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
public Feed getFeed(Integer page) {
	try {
		Feed feed = new Feed();
		feed.setId(getFeedId());
		feed.setTitle(getFeedTitle());
		feed.getLinks().addAll(generateLinks(page));
		feed.getAuthors().addAll(getAuthors());
		feed.getEntries().addAll(generateEntries(page));
		feed.setUpdated(feed.getEntries().isEmpty() ? new Date() : feed.getEntries().get(0).getUpdated());
		return feed;
	} catch (URISyntaxException e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:nordinh,项目名称:atom-feed,代码行数:15,代码来源:AtomFeedProducer.java

示例7: getFeed

import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
@GET
@Path("/feed")
@Produces("application/atom+xml")
public Feed getFeed() throws URISyntaxException
{
    Feed feed = new Feed();
    feed.setId(new URI("http://example.com/42"));
    feed.setTitle("Veterinarians");
    feed.setUpdated(new Date());
    Link link = new Link();
    link.setHref(new URI("http://localhost"));
    link.setRel("edit");
    feed.getLinks().add(link);
    feed.getAuthors().add(new Person("Thomas Woehlke"));
    for(Vet vet:vetDao.getAll()){
        Entry entry = new Entry();
        entry.setTitle("Vet: "+vet.getFirstName()+" "+vet.getLastName());
        Content content = new Content();
        content.setType(MediaType.TEXT_HTML_TYPE);
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("[");
        Iterator<Specialty> i = vet.getSpecialties().iterator();
        while(i.hasNext() ){
            stringBuilder.append(i.next().getName());
            if(i.hasNext()){
                stringBuilder.append(", ");
            }
        }
        stringBuilder.append("]");
        content.setText(stringBuilder.toString());
        entry.setContent(content);
        feed.getEntries().add(entry);
    }
    return feed;
}
 
开发者ID:phasenraum2010,项目名称:javaee7-petclinic,代码行数:36,代码来源:VetWebservice.java

示例8: feedBasicAsserts

import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
private void feedBasicAsserts(FeedRestService tested, UriInfo uriInfo, MultivaluedMap<String, String> qp,
		QuerySettings qs, Object response) {
	Mockito.verify(uriInfo, Mockito.times(2)).getQueryParameters();
	Mockito.verify(tested.querySettingsParser).parseUriParams(qp);
	Mockito.verify(tested.searchService).performSearch(Mockito.eq(qs), Mockito.notNull(String.class),
			Mockito.eq(StatsRecordType.FEED));
	Assert.assertTrue("Bad class instead of Feed: " + response.getClass().getName(), response instanceof Feed);
}
 
开发者ID:macanhhuy,项目名称:dcp-api,代码行数:9,代码来源:FeedRestServiceTest.java

示例9: getFeed

import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
@Override
@Timed
public Feed getFeed() {
	return super.getFeed();
}
 
开发者ID:nordinh,项目名称:atom-feed,代码行数:6,代码来源:NotificationFeedProducer.java

示例10: getFeed

import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
@GET
@Path("/notifications")
@Produces("application/atom+xml")
public Feed getFeed();
 
开发者ID:nordinh,项目名称:atom-feed,代码行数:5,代码来源:NotificationFeed.java


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