Package org.vietspider.serialize

Examples of org.vietspider.serialize.XML2Bean.toBean()


    String text = document.getTextValue();
    System.out.println(text);
   
   
    XML2Bean xml2Bean = XML2Bean.getInstance();
    Student student2 = xml2Bean.toBean(Student.class, text);
   
    System.out.println("\nstudent 2 name: " +student2.getName());
   
  }
 
View Full Code Here


    MetaDocument document = null;
   
    for(XMLNode child : children) {
      if(child.isNode(CHANNEL)) {
        if(document == null) document = new MetaDocument();
        document.setChannel(toBean.toBean(RSSChannel.class, child));
        itemNodes = child.getChildren();
        if(itemNodes == null) return document;
        for(XMLNode itemNode : itemNodes) {
          if(!itemNode.isNode(ITEM)) continue;
          RSSItem rssItem = toBean.toBean(RSSItem.class, itemNode);
View Full Code Here

        document.setChannel(toBean.toBean(RSSChannel.class, child));
        itemNodes = child.getChildren();
        if(itemNodes == null) return document;
        for(XMLNode itemNode : itemNodes) {
          if(!itemNode.isNode(ITEM)) continue;
          RSSItem rssItem = toBean.toBean(RSSItem.class, itemNode);
          parseRSSLink(itemNode, rssItem);
          document.addItem(rssItem);
        }
      } else if(child.isNode(FEED)) {
        if(document == null) document = new MetaDocument();
View Full Code Here

          parseRSSLink(itemNode, rssItem);
          document.addItem(rssItem);
        }
      } else if(child.isNode(FEED)) {
        if(document == null) document = new MetaDocument();
        document.setChannel(toBean.toBean(FeedItem.class, child));
        itemNodes = child.getChildren();
        if(itemNodes == null) return document;
       
        for(XMLNode itemNode : itemNodes) {
          if(!itemNode.isNode(ENTRY)) continue;
View Full Code Here

        itemNodes = child.getChildren();
        if(itemNodes == null) return document;
       
        for(XMLNode itemNode : itemNodes) {
          if(!itemNode.isNode(ENTRY)) continue;
          EntryItem entryItem = toBean.toBean(EntryItem.class, itemNode);
          parseEntryLink(itemNode, entryItem);
          document.addItem(entryItem);
        }
      } else if(child.isNode(ITEM)) {
        if(document == null) document = new MetaDocument();
View Full Code Here

          parseEntryLink(itemNode, entryItem);
          document.addItem(entryItem);
        }
      } else if(child.isNode(ITEM)) {
        if(document == null) document = new MetaDocument();
        RSSItem rssItem = toBean.toBean(RSSItem.class, child);
        parseRSSLink(child, rssItem);
        document.addItem(rssItem);
      }
    }
    return document;
View Full Code Here

    if(children == null) return ;
    XML2Bean toBean = XML2Bean.getInstance();
   
    for(XMLNode child : children) {
      if(!child.isNode(LINK)) continue;
      MetaLink metaLink = toBean.toBean(MetaLink.class, child);
      if(metaLink.getHref() == null || metaLink.getHref().trim().isEmpty()) {
        Attributes attributes = AttributeParser.parse(child);
        Attribute attribute = attributes.get(REF);
        if(attribute != null) metaLink.setHref(attribute.getValue());
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.