コード例 #1
0
 /*package*/
 static List<Comment> constructStatuses(Response res, Weibo weibo) throws WeiboException {
   Document doc = res.asDocument();
   if (isRootNodeNilClasses(doc)) {
     return new ArrayList<Comment>(0);
   } else {
     try {
       ensureRootNodeNameIs("statuses", doc);
       NodeList list = doc.getDocumentElement().getElementsByTagName("status");
       int size = list.getLength();
       List<Comment> statuses = new ArrayList<Comment>(size);
       for (int i = 0; i < size; i++) {
         Element status = (Element) list.item(i);
         statuses.add(new Comment(res, status, weibo));
       }
       return statuses;
     } catch (WeiboException te) {
       ensureRootNodeNameIs("nil-classes", doc);
       return new ArrayList<Comment>(0);
     }
   }
 }
コード例 #2
0
 /*package*/ Comment(Response res, Weibo weibo) throws WeiboException {
   super(res);
   Element elem = res.asDocument().getDocumentElement();
   init(res, elem, weibo);
 }