本文整理汇总了Java中org.jboss.resteasy.plugins.providers.atom.Feed.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java Feed.setTitle方法的具体用法?Java Feed.setTitle怎么用?Java Feed.setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.resteasy.plugins.providers.atom.Feed
的用法示例。
在下文中一共展示了Feed.setTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: 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);
}
}
示例3: 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;
}