Package com.sun.syndication.feed.synd

Examples of com.sun.syndication.feed.synd.SyndContent


            newEntry.setPubTime(newEntry.getUpdateTime());
        }
       
        // get content and unescape if it is 'text/plain'
        if (romeEntry.getContents().size() > 0) {
            SyndContent content= (SyndContent)romeEntry.getContents().get(0);
            if (content != null && content.getType().equals("text/plain")) {
                newEntry.setText(StringEscapeUtils.unescapeHtml(content.getValue()));
            } else if (content != null) {
                newEntry.setText(content.getValue());
            }
        }
       
        // no content, try summary
        if (newEntry.getText() == null || newEntry.getText().trim().length() == 0) {
View Full Code Here


     */
    public boolean matchesFeed(SyndFeed syndFeed)
    {
        List contents;
        SyndEntry entry;
        SyndContent content;
        List entries = syndFeed.getEntries();
        for (int i = 0; i < entries.size(); i++)
        {
            entry = (SyndEntry) entries.get(i);

            // Check Description
            content = entry.getDescription();
            if(content!=null)
            {
                if(isMatch(content.getValue())) return true;
            }

            // Check Contents
            contents = entry.getContents();
            for (int j = 0; j < contents.size(); j++)
            {
                content = (SyndContent) contents.get(j);
                if(isMatch(content.getValue())) return true;
            }
        }
        return false;
    }
View Full Code Here

        return aFeed;
    }

    protected SyndContent createSyndContent(Content content) {
        SyndContent sContent = new SyndContentImpl();
        sContent.setType(content.getType());
        sContent.setValue(content.getValue());
        return sContent;
    }
View Full Code Here

                aCats.add(aCat);
            }
        }
        if (aCats.size() > 0) aEntry.setCategories(aCats);
       
        SyndContent sDescription = sEntry.getDescription();
        if (sDescription!=null) {
            Content summary = new Content();
            summary.setType(sDescription.getType());
            summary.setValue(sDescription.getValue());
            aEntry.setSummary(summary);
        }

        // take first item in contents collection as the content
        List syndContents = sEntry.getContents();
        if (syndContents != null && syndContents.size() > 0) {
            SyndContent syndContent = (SyndContent)syndContents.get(0);
            Content content = new Content();
            content.setType(syndContent.getType());
            content.setValue(syndContent.getValue());
            aEntry.setSummary(content);
        }

        List authors = sEntry.getAuthors();
        if (authors!=null && authors.size() > 0) {
View Full Code Here

    protected SyndEntry createSyndEntry(Item item) {
        SyndEntry syndEntry = super.createSyndEntry(item);
        Description desc = item.getDescription();
        if (desc!=null) {
            SyndContent content = new SyndContentImpl();
            content.setType(desc.getType());
            content.setValue(desc.getValue());
            syndEntry.setDescription(content);

            // contents[0] and description then reference the same content
            //
            List contents = new ArrayList();
View Full Code Here

    }

    protected Item createRSSItem(SyndEntry sEntry) {
        Item item = super.createRSSItem(sEntry);

        SyndContent sContent = sEntry.getDescription();
        if (sContent!=null) {
            item.setDescription(createItemDescription(sContent));
        }
        return item;
    }
View Full Code Here

    protected SyndEntry createSyndEntry(Item item) {
        SyndEntry syndEntry = super.createSyndEntry(item);
        Description desc = item.getDescription();
        if (desc!=null) {
            SyndContent content = new SyndContentImpl();
            content.setType(desc.getType());
            content.setValue(desc.getValue());
            syndEntry.setDescription(content);

            // contents[0] and description then reference the same content
            //
            List contents = new ArrayList();
View Full Code Here

    }

    protected Item createRSSItem(SyndEntry sEntry) {
        Item item = super.createRSSItem(sEntry);

        SyndContent sContent = sEntry.getDescription();
        if (sContent!=null) {
            item.setDescription(createItemDescription(sContent));
        }
        return item;
    }
View Full Code Here

            if (contents!=null && contents.size()>0) {
                content = (Content) contents.get(0);
            }
        }
        if (content!=null) {
            SyndContent sContent = new SyndContentImpl();
            sContent.setType(content.getType());
            sContent.setValue(content.getValue());
            syndEntry.setDescription(sContent);
        }

        List contents = entry.getContents();
        if (contents.size()>0) {
            List sContents = new ArrayList();
            for (int i=0;i<contents.size();i++) {
                content = (Content) contents.get(i);
                SyndContent sContent = new SyndContentImpl();
                sContent.setType(content.getType());
                sContent.setValue(content.getValue());
                sContents.add(sContent);
            }
            syndEntry.setContents(sContents);
        }
View Full Code Here

            List list = new ArrayList();
            list.add(link);
            aEntry.setAlternateLinks(list);
        }

        SyndContent sContent = sEntry.getDescription();
        if (sContent!=null) {
            Content content = new Content();
            content.setType(sContent.getType());
            content.setValue(sContent.getValue());
            content.setMode(Content.ESCAPED);
            aEntry.setSummary(content);
        }

        List contents = sEntry.getContents();
        if (contents.size()>0) {
            List aContents = new ArrayList();
            for (int i=0;i<contents.size();i++) {
                sContent = (SyndContentImpl) contents.get(i);
                Content content = new Content();
                content.setType(sContent.getType());
                content.setValue(sContent.getValue());
                content.setMode(Content.ESCAPED);
                aContents.add(content);

            }
            aEntry.setContents(aContents);
View Full Code Here

TOP

Related Classes of com.sun.syndication.feed.synd.SyndContent

Copyright © 2018 www.massapicom. 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.