001: /*
002: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
003: * Distributed under the terms of either:
004: * - the common development and distribution license (CDDL), v1.0; or
005: * - the GNU Lesser General Public License, v2.1 or later
006: * $Id: Entry.java 3634 2007-01-08 21:42:24Z gbevin $
007: */
008: package com.uwyn.rife.feed;
009:
010: import java.util.Date;
011:
012: /**
013: * A bean representing an entry in a feed.
014: * <p>An <code>Entry</code> is a single piece of content, (forum message, news article,
015: * blog post), with it's own title, link to permanent content,
016: * published date, content and author. Has a many-to-one relationship
017: * with <code>Feed</code>.
018: *
019: * @author JR Boyens (jboyens[remove] at uwyn dot com)
020: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
021: * @version $Revision: 3634 $
022: * @see com.uwyn.rife.feed.Feed
023: * @since 1.0
024: */
025: public class Entry {
026: private String mId = null;
027: private String mTitle = null;
028: private String mLink = null;
029: private Date mPublishedDate = null;
030: private String mContent = null;
031: private String mAuthor = null;
032: private String mType = "text/html";
033: private boolean mEscaped = true;
034:
035: public Entry author(String author) {
036: setAuthor(author);
037: return this ;
038: }
039:
040: public String getAuthor() {
041: return mAuthor;
042: }
043:
044: public void setAuthor(String author) {
045: mAuthor = author;
046: }
047:
048: public Entry content(String content) {
049: setContent(content);
050: return this ;
051: }
052:
053: public String getContent() {
054: return mContent;
055: }
056:
057: public void setContent(String content) {
058: mContent = content;
059: }
060:
061: public Entry id(String id) {
062: setId(id);
063: return this ;
064: }
065:
066: public String getId() {
067: if (null == mId) {
068: return getLink();
069: }
070:
071: return mId;
072: }
073:
074: public void setId(String id) {
075: mId = id;
076: }
077:
078: public Entry link(String link) {
079: setLink(link);
080: return this ;
081: }
082:
083: public String getLink() {
084: return mLink;
085: }
086:
087: public void setLink(String link) {
088: mLink = link;
089: }
090:
091: public Entry publishedDate(Date publishedDate) {
092: setPublishedDate(publishedDate);
093: return this ;
094: }
095:
096: public Date getPublishedDate() {
097: return mPublishedDate;
098: }
099:
100: public void setPublishedDate(Date publishedDate) {
101: mPublishedDate = publishedDate;
102: }
103:
104: public Entry title(String title) {
105: setTitle(title);
106: return this ;
107: }
108:
109: public String getTitle() {
110: return mTitle;
111: }
112:
113: public void setTitle(String title) {
114: mTitle = title;
115: }
116:
117: public String getType() {
118: return mType;
119: }
120:
121: public void setType(String type) {
122: mType = type;
123: }
124:
125: public Entry type(String type) {
126: setType(type);
127:
128: return this ;
129: }
130:
131: public boolean isEscaped() {
132: return mEscaped;
133: }
134:
135: public void setEscaped(boolean escaped) {
136: mEscaped = escaped;
137: }
138:
139: public Entry escaped(boolean escaped) {
140: setEscaped(escaped);
141: return this;
142: }
143: }
|