All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sun.syndication.io.impl.RSS10Generator Maven / Gradle / Ivy

There is a newer version: 3.1.0-incubating
Show newest version
/*
 * Copyright 2004 Sun Microsystems, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
package com.sun.syndication.io.impl;

import com.sun.syndication.feed.rss.Description;
import com.sun.syndication.feed.rss.Item;
import com.sun.syndication.feed.rss.Channel;
import com.sun.syndication.io.FeedException;
import org.jdom2.Element;
import org.jdom2.Namespace;

import java.util.List;

/**
 * Feed Generator for RSS 1.0
 * 

* * @author Elaine Chien * */ public class RSS10Generator extends RSS090Generator { private static final String RSS_URI = "http://purl.org/rss/1.0/"; private static final Namespace RSS_NS = Namespace.getNamespace(RSS_URI); public RSS10Generator() { super("rss_1.0"); } protected RSS10Generator(String feedType) { super(feedType); } protected Namespace getFeedNamespace() { return RSS_NS; } protected void populateChannel(Channel channel,Element eChannel) { super.populateChannel(channel,eChannel); if (channel.getUri() != null) { eChannel.setAttribute("about", channel.getUri(), getRDFNamespace()); } List items = channel.getItems(); if (items.size()>0) { Element eItems = new Element("items",getFeedNamespace()); Element eSeq = new Element("Seq",getRDFNamespace()); for (int i=0;i





© 2015 - 2025 Weber Informatics LLC | Privacy Policy