Package com.sun.syndication.io

Examples of com.sun.syndication.io.FeedException


            for (int i=0;i<hours.size();i++) {
                Element hour = (Element) hours.get(i);
                int value = Integer.parseInt(hour.getText());
                if (isHourFormat24()) {
                    if (value<1 || value>24) {
                        throw new FeedException("Invalid hour value "+value+", it must be between 1 and 24");
                    }
                }
                else {
                    if (value<0 || value>23) {
                        throw new FeedException("Invalid hour value "+value+", it must be between 0 and 23");
                    }
                }
            }
        }
    }
View Full Code Here


        root.setNamespace(RDF_NS);
        root.addNamespaceDeclaration(RDF_NS);
        root.addNamespaceDeclaration(RSS_NS);

        if (channel == null) {
            throw new FeedException("invalid RSS Channel - missing required channel element");
        }
        root.addContent(generateChannelElement(channel));

        if (channel.getImage() != null) {
            root.addContent(generateImageElement(channel.getImage()));
View Full Code Here

        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", RSS_NS);
        channelElement.addContent(generateSimpleElement("title", title, RSS_NS));
        channelElement.addContent(generateSimpleElement("link", link, RSS_NS));
View Full Code Here

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

        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");
        }
        if (link == null) {
            throw new FeedException("invalid RSS Image - missing required link element");
        }

        Element imageElement = new Element("image", RSS_NS);
        imageElement.addContent(generateSimpleElement("title", title, RSS_NS));
        imageElement.addContent(generateSimpleElement("url", url, RSS_NS));
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", RSS_NS);
        itemElement.addContent(generateSimpleElement("title", title, RSS_NS));
        itemElement.addContent(generateSimpleElement("link", link, RSS_NS));
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", RSS_NS);
        textInputElement.addContent(generateSimpleElement("title", title, RSS_NS));
        textInputElement.addContent(generateDescriptionElement(textInput.getDescription(), RSS_NS));
View Full Code Here

        root.addNamespaceDeclaration(SY_NS);
        root.addNamespaceDeclaration(TAXO_NS);
        root.addNamespaceDeclaration(RSS_NS);

        if (channel == null) {
            throw new FeedException("invalid RSS Channel - missing required channel element");
        }
        root.addContent(generateChannelElement(channel));

        if (channel.getImage() != null) {
            root.addContent(generateImageElement(channel.getImage()));
View Full Code Here

        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", RSS_NS);

        channelElement.addContent(generateSimpleElement("title", title, RSS_NS));
        channelElement.addContent(generateSimpleElement("link", link, RSS_NS));
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", RSS_NS);
        textInputElement.addContent(generateSimpleElement("title", title, RSS_NS));
        textInputElement.addContent(generateDescriptionElement(textInput.getDescription(), RSS_NS));
View Full Code Here

        Element root = new Element("rss");
        Attribute version = new Attribute("version", getVersion());
        root.setAttribute(version);

        if (channel == null) {
            throw new FeedException("invalid RSS Channel - missing required channel element");
        }
        root.addContent(generateChannelElement(channel));
        return root;

    }
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.