org.apache.abdera.model.Feed.getEntries()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中org.apache.abdera.model.Feed.getEntries()方法的一些代码示例,展示了Feed.getEntries()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Feed.getEntries()方法的具体详情如下:
包路径:org.apache.abdera.model.Feed
类名称:Feed
方法名:getEntries

Feed.getEntries介绍

[英]Returns the complete set of entries contained in this feed
[中]返回此提要中包含的完整条目集

代码示例

代码示例来源:origin: rackerlabs/atom-hopper

@Override
  public void process(RequestContext rc, AdapterResponse<Feed> adapterResponse) {
    final Feed f = adapterResponse.getBody();

    // If there are no entries in the feed
    if (f == null || f.getEntries() == null || f.getEntries().isEmpty()) {
      return;
    }
    // Add an updated element to the feed
    final Calendar localNow = Calendar.getInstance(TimeZone.getDefault());
    localNow.setTimeInMillis(System.currentTimeMillis());
    f.setUpdated(localNow.getTime());
  }
}

代码示例来源:origin: stackoverflow.com

public static void printAllPosts(
  GoogleService myService, String blogId)
  throws ServiceException, IOException {
 // Request the feed
 URL feedUrl = new URL("http://www.blogger.com/feeds/" + blogID + "/posts/default");
 Feed resultFeed = myService.getFeed(feedUrl, Feed.class);

 // Print the results
 System.out.println(resultFeed.getTitle().getPlainText());
 for (int i = 0; i < resultFeed.getEntries().size(); i++) {
  Entry entry = resultFeed.getEntries().get(i);
  System.out.println("\t" + entry.getTitle().getPlainText());
 }
 System.out.println();
}

代码示例来源:origin: apache/cxf

protected Feed createFeedFromCollectionWrapper(Factory factory, Object o, Class<?> pojoClass)
  throws Exception {
  Feed feed = factory.newFeed();
  boolean writerUsed = buildFeed(feed, o, pojoClass);
  if (feed.getEntries().size() > 0) {
    return feed;
  }
  String methodName = getCollectionMethod(o.getClass(), true);
  Object collection = null;
  Method m = null;
  try {
    m = o.getClass().getMethod(methodName, new Class[]{});
    collection = m.invoke(o, new Object[]{});
  } catch (Exception ex) {
    reportError("Collection for " + o.getClass().getName() + " can not be retrieved", ex);
  }
  setFeedFromCollection(factory, feed, o, pojoClass, collection, m.getReturnType(),
             m.getGenericReturnType(), writerUsed);
  return feed;
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

protected Feed createFeedFromCollectionWrapper(Factory factory, Object o, Class<?> pojoClass) 
  throws Exception {
  
  Feed feed = factory.newFeed();
  
  boolean writerUsed = buildFeed(feed, o, pojoClass);
  
  if (feed.getEntries().size() > 0) {
    return feed;
  }
  
  String methodName = getCollectionMethod(o.getClass(), true);
  Object collection = null;
  Method m = null;
  try {
    m = o.getClass().getMethod(methodName, new Class[]{});
    collection = m.invoke(o, new Object[]{});
  } catch (Exception ex) {
    reportError("Collection for " + o.getClass().getName() + " can not be retrieved", ex);
  }
  
  setFeedFromCollection(factory, feed, o, pojoClass, collection, m.getReturnType(), 
             m.getGenericReturnType(), writerUsed);
  return feed;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-rs-extension-providers

protected Feed createFeedFromCollectionWrapper(Factory factory, Object o, Class<?> pojoClass)
  throws Exception {
  Feed feed = factory.newFeed();
  boolean writerUsed = buildFeed(feed, o, pojoClass);
  if (feed.getEntries().size() > 0) {
    return feed;
  }
  String methodName = getCollectionMethod(o.getClass(), true);
  Object collection = null;
  Method m = null;
  try {
    m = o.getClass().getMethod(methodName, new Class[]{});
    collection = m.invoke(o, new Object[]{});
  } catch (Exception ex) {
    reportError("Collection for " + o.getClass().getName() + " can not be retrieved", ex);
  }
  setFeedFromCollection(factory, feed, o, pojoClass, collection, m.getReturnType(),
             m.getGenericReturnType(), writerUsed);
  return feed;
}

代码示例来源:origin: rackerlabs/atom-hopper

@Override
public void process(RequestContext rc, AdapterResponse<Feed> adapterResponse) {
  final Feed f = adapterResponse.getBody();
  if(f == null) {
    return;
  }
  final int totalEntries = f.getEntries().size();
  // If there are no entries in the feed
  if (totalEntries == 0) {
    return;
  }
  // Get the id of the first entry on this page
  String id = f.getEntries().get(0).getId().toString();
  // Get the id of the last entry on this page
  String lastId = f.getEntries().get(totalEntries-1).getId().toString();
  EntityTag feedEtag = createEntityTag(rc, id, lastId);
  adapterResponse.setEntityTag(feedEtag);
}

代码示例来源:origin: org.apache.cxf/cxf-rt-management-web

if (condition == null && feed.getEntries().size() == pageSize) {
  synchronized (feeds) {
    feeds.put(page, feed);

代码示例来源:origin: org.fcrepo/fcrepo-server

private void addDatastreams(Feed feed, DigitalObject obj,
    String encoding, int transContext, File tempDir)
    throws UnsupportedEncodingException, StreamIOException, ObjectIntegrityException {
  feed.sortEntries(new UpdatedIdComparator(true));
  List<Entry> entries = feed.getEntries();
  for (Entry entry : entries) {
    if (ThreadHelper.getInReplyTo(entry) != null) {
      addDatastreamVersion(feed, entry, obj, encoding, transContext, tempDir);
    }
  }
}

代码示例来源:origin: fcrepo3/fcrepo

private void addDatastreams(Feed feed, DigitalObject obj,
    String encoding, int transContext, File tempDir)
    throws UnsupportedEncodingException, StreamIOException, ObjectIntegrityException {
  feed.sortEntries(new UpdatedIdComparator(true));
  List<Entry> entries = feed.getEntries();
  for (Entry entry : entries) {
    if (ThreadHelper.getInReplyTo(entry) != null) {
      addDatastreamVersion(feed, entry, obj, encoding, transContext, tempDir);
    }
  }
}

代码示例来源:origin: rackerlabs/atom-hopper

if ( hydratedFeed.getEntries() != null && hydratedFeed.getEntries().size() < pageSize ) {
  LOG.warn("User requested " + getFeedRequest.getFeedName() + " feed with limit " + pageSize + ", but returning only " + hydratedFeed.getEntries().size());
  List<Entry> entries = hydratedFeed.getEntries();
  StringBuilder sb = new StringBuilder();
  for (int idx=0; idx<entries.size(); idx++) {
} else if ( hydratedFeed.getEntries() == null ) {
  LOG.warn("User requested " + getFeedRequest.getFeedName() + " feed with limit " + pageSize + ", but no entries are available");

代码示例来源:origin: net.sf.taverna.t2.activities/interaction-activity

final Feed feed = doc.getRoot().sortEntriesByEdited(true);
for (final Entry entry : feed.getEntries()) {

代码示例来源:origin: apache/cxf

= (Class<Object>)InjectionUtils.getActualType(m.getGenericParameterTypes()[0]);
List<Object> objects = new ArrayList<>();
for (Entry e : feed.getEntries()) {
  objects.add(readFromEntry(e, realCls));

代码示例来源:origin: org.apache.cxf/cxf-rt-rs-extension-providers

= (Class<Object>)InjectionUtils.getActualType(m.getGenericParameterTypes()[0]);
List<Object> objects = new ArrayList<>();
for (Entry e : feed.getEntries()) {
  objects.add(readFromEntry(e, realCls));

代码示例来源:origin: stackoverflow.com

GoogleService myService = new GoogleService("blogger", "exampleCo-exampleApp-1");
   myService.setUserCredentials("EMAIL", "PWD");
   Entry myEntry = new Entry();
   myEntry.setTitle(new PlainTextConstruct("TITLE post update"));
   myEntry.setContent(new PlainTextConstruct("STATUS POST"));
   URL feedUrl = new URL("http://www.blogger.com/feeds/default/blogs");
   Feed resultFeed = myService.getFeed(feedUrl, Feed.class);
   String blog_name = "blog_name"; //the name of the blog where you want to post status
   String BLOG_ID = "";
   for (int i = 0; i < resultFeed.getEntries().size(); i++) {
     Entry entry = resultFeed.getEntries().get(i);
     if (entry.getTitle().getPlainText().equalsIgnoreCase(blog_name)) {
       String[] split = entry.getId().split("-");
       BLOG_ID = split[split.length - 1];
     }
     System.out.println("Posting to:" + " " + "Blog id: " + BLOG_ID + " " + "Blog name: " + blog_name);
   }
   URL postUrl = new URL("http://www.blogger.com/feeds/" + BLOG_ID + "/posts/default");
   Entry insert = myService.insert(postUrl, myEntry);
   System.out.println(insert.getHtmlLink().getHref());

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

= (Class<Object>)InjectionUtils.getActualType(m.getGenericParameterTypes()[0]);
List<Object> objects = new ArrayList<Object>();
for (Entry e : feed.getEntries()) {
  objects.add(readFromEntry(e, realCls));

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-atom-runtime

for (org.apache.abdera.model.Entry feedEntry : feed.getEntries()) {
  Entry<Object, Object> entry =
    entry(feedEntry,

代码示例来源:origin: org.apache.cxf/cxf-rt-management-web

feed.addLink(self, "self");
int feedSize = feed.getEntries().size();
String searchExpression = getSearchExpression();

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-atom-runtime

for (org.apache.abdera.model.Entry feedEntry : feed.getEntries()) {
  Entry<Object, Object> entry =
    entry(feedEntry,

代码示例来源:origin: apache/cxf

} else {
  feed.setTitle(String.format(wrapper.getClass().getSimpleName()
         + " collection with %d entry(ies)", feed.getEntries().size()));

代码示例来源:origin: org.apache.cxf/cxf-rt-rs-extension-providers

} else {
  feed.setTitle(String.format(wrapper.getClass().getSimpleName()
         + " collection with %d entry(ies)", feed.getEntries().size()));

相关文章