Package com.sun.syndication.io

Examples of com.sun.syndication.io.FeedException


        String title = channel.getTitle();
        String link = channel.getLink();
        String description = channel.getDescription();

        if (title == null) {
            throw new FeedException("invalid RSS Channel - missing required title element");
        }
        if (link == null) {
            throw new FeedException("invalid RSS Channel - missing required link element");
        }
        if (description == null) {
            throw new FeedException("invalid RSS Channel - missing required description element");
        }

        Element channelElement = new Element("channel");
        channelElement.addContent(generateSimpleElement("title", title));
        channelElement.addContent(generateSimpleElement("link", link));
View Full Code Here


    protected Element generateLanguageElement(String language)
        throws FeedException {

        if (language == null) {
            throw new FeedException("invalid RSS Channel - missing required language element");
        } else {
            return generateSimpleElement("language", language);
        }
    }
View Full Code Here

        String title = image.getTitle();
        String url = image.getUrl();

        if (title == null) {
            throw new FeedException("invalid RSS Image - missing required title element");
        }
        if (url == null) {
            throw new FeedException("invalid RSS Image - missing required url element");
        }

        Element imageElement = new Element("image");
        imageElement.addContent(generateSimpleElement("title", title));
        imageElement.addContent(generateSimpleElement("url", url));
View Full Code Here

        String title = item.getTitle();
        String link = item.getLink();

        if (title == null) {
            throw new FeedException("invalid RSS Item - missing required title element");
        }
        if (link == null) {
            throw new FeedException("invalid RSS Item - missing required link element");
        }

        Element itemElement = new Element("item");
        itemElement.addContent(generateSimpleElement("title", title));
        itemElement.addContent(generateSimpleElement("link", link));
View Full Code Here

        String description = textInput.getDescription();
        String name = textInput.getName();
        String link = textInput.getLink();

        if (title == null) {
            throw new FeedException("invalid RSS TextInput - missing required title element");
        }
        if (description == null) {
            throw new FeedException("invalid RSS TextInput - missing required description element");
        }
        if (name == null) {
            throw new FeedException("invalid RSS TextInput - missing required name element");
        }
        if (link == null) {
            throw new FeedException("invalid RSS TextInput - missing required link element");
        }

        Element textInputElement = new Element("textInput");
        textInputElement.addContent(generateSimpleElement("title", title));
        textInputElement.addContent(generateDescriptionElement(textInput.getDescription()));
View Full Code Here

        Attribute version = new Attribute("version", VERSION);
        root.setAttribute(version);

        if (feed == null) {
            throw new FeedException("invalid Atom Feed - missing required feed element");
        }

        if (feed.getTitle() != null) {
            root.addContent(generateSimpleElement("title", feed.getTitle()));
        }
View Full Code Here

                try {
                    SAXBuilder saxBuilder = new SAXBuilder();
                    tmpDoc = saxBuilder.build(tmpDocReader);
                }
                catch (Exception ex) {
                    throw new FeedException("Invalid XML",ex);
                }

                List children = tmpDoc.getRootElement().removeContent();
                contentElement.addContent(children);
            }
View Full Code Here

TOP

Related Classes of com.sun.syndication.io.FeedException

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.