001: /*
002: * Copyright (c) JForum Team
003: * All rights reserved.
004: *
005: * Redistribution and use in source and binary forms,
006: * with or without modification, are permitted provided
007: * that the following conditions are met:
008: *
009: * 1) Redistributions of source code must retain the above
010: * copyright notice, this list of conditions and the
011: * following disclaimer.
012: * 2) Redistributions in binary form must reproduce the
013: * above copyright notice, this list of conditions and
014: * the following disclaimer in the documentation and/or
015: * other materials provided with the distribution.
016: * 3) Neither the name of "Rafael Steil" nor
017: * the names of its contributors may be used to endorse
018: * or promote products derived from this software without
019: * specific prior written permission.
020: *
021: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
022: * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
023: * EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
024: * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
025: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR
026: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
027: * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
028: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
029: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES
030: * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
031: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
032: * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
033: * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
034: * IN CONTRACT, STRICT LIABILITY, OR TORT
035: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
036: * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
037: * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
038: *
039: * Created on 20/10/2004 22:59:58
040: * The JForum Project
041: * http://www.jforum.net
042: */
043: package net.jforum.util.rss;
044:
045: import java.util.ArrayList;
046: import java.util.List;
047:
048: /**
049: * Represents a RSS document
050: *
051: * @author Rafael Steil
052: * @version $Id: RSS.java,v 1.4 2006/08/23 02:13:38 rafaelsteil Exp $
053: */
054: public class RSS {
055: private List itens;
056: private String title;
057: private String description;
058: private String encoding;
059: private String link;
060:
061: /**
062: * Creates a new RSS document.
063: *
064: * @param title The document title
065: * @param description The document description
066: * @param encoding The character encoding
067: * @param link The main document link
068: */
069: public RSS(String title, String description, String encoding,
070: String link) {
071: this .itens = new ArrayList();
072: this .title = title;
073: this .description = description;
074: this .encoding = encoding;
075: this .link = link;
076: }
077:
078: /**
079: * Gets the main document link
080: * @return The document link
081: */
082: public String getLink() {
083: return this .link;
084: }
085:
086: /**
087: * Gets he document title
088: * @return The document title
089: */
090: public String getTitle() {
091: return this .title;
092: }
093:
094: /**
095: * Gets the document description
096: * @return The document description
097: */
098: public String getDescription() {
099: return this .description;
100: }
101:
102: /**
103: * Gets the document character encoding
104: * @return The encoding
105: */
106: public String getEncoding() {
107: return this .encoding;
108: }
109:
110: /**
111: * Gets all <code>RSSItem</code> instances related
112: * to this RSS document.
113: *
114: * @return <code>java.util.List</code> with the entries
115: */
116: public List getItens() {
117: return this .itens;
118: }
119:
120: /**
121: * Add a new item to the RSS document
122: *
123: * @param entry <code>RSSItem</code> object containing the item information
124: */
125: public void addItem(RSSItem item) {
126: this.itens.add(item);
127: }
128: }
|