Package com.rometools.rome.feed.rss

Examples of com.rometools.rome.feed.rss.Image


     * @param rssRoot the root element of the RSS document to parse for image information.
     * @return the parsed image bean.
     */
    protected Image parseImage(final Element rssRoot) {

        Image image = null;

        final Element eImage = getImage(rssRoot);
        if (eImage != null) {

            image = new Image();

            final Element title = eImage.getChild("title", getRSSNamespace());
            if (title != null) {
                image.setTitle(title.getText());
            }

            final Element url = eImage.getChild("url", getRSSNamespace());
            if (url != null) {
                image.setUrl(url.getText());
            }

            final Element link = eImage.getChild("link", getRSSNamespace());
            if (link != null) {
                image.setLink(link.getText());
            }

        }

        return image;
View Full Code Here


        syndFeed.setTitle(channel.getTitle());
        syndFeed.setLink(channel.getLink());
        syndFeed.setDescription(channel.getDescription());

        final Image image = channel.getImage();
        if (image != null) {
            syndFeed.setImage(createSyndImage(image));
        }

        final List<Item> items = channel.getItems();
View Full Code Here

        return channel;
    }

    protected Image createRSSImage(final SyndImage sImage) {
        final Image image = new Image();
        image.setTitle(sImage.getTitle());
        image.setUrl(sImage.getUrl());
        image.setLink(sImage.getLink());
        return image;
    }
View Full Code Here

     * @return the parsed RSSImage bean.
     */
    @Override
    protected Image parseImage(final Element rssRoot) {

        final Image image = super.parseImage(rssRoot);
        if (image != null) {

            final Element eImage = getImage(rssRoot);

            final Element width = eImage.getChild("width", getRSSNamespace());
            if (width != null) {
                final Integer val = NumberParser.parseInt(width.getText());
                if (val != null) {
                    image.setWidth(val);
                }
            }

            final Element height = eImage.getChild("height", getRSSNamespace());
            if (height != null) {
                final Integer val = NumberParser.parseInt(height.getText());
                if (val != null) {
                    image.setHeight(val);
                }
            }

            final Element description = eImage.getChild("description", getRSSNamespace());
            if (description != null) {
                image.setDescription(description.getText());
            }

        }

        return image;
View Full Code Here

        return desc;
    }

    @Override
    protected Image createRSSImage(final SyndImage sImage) {
        final Image image = super.createRSSImage(sImage);
        image.setDescription(sImage.getDescription());
        return image;
    }
View Full Code Here

            }
        }
    }

    protected void addImage(final Channel channel, final Element parent) throws FeedException {
        final Image image = channel.getImage();
        if (image != null) {
            final Element eImage = new Element("image", getFeedNamespace());
            populateImage(image, eImage);
            checkImageConstraints(eImage);
            parent.addContent(eImage);
View Full Code Here

TOP

Related Classes of com.rometools.rome.feed.rss.Image

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.