1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.sun.syndication.feed.synd;
18
19 import com.sun.syndication.common.ObjectBean;
20 import com.sun.syndication.common.impl.CopyFromHelper;
21
22 import java.util.Collections;
23 import java.util.HashMap;
24 import java.util.Map;
25
26 /***
27 * Bean for content of SyndFeedImpl entries.
28 * <p>
29 * @author Alejandro Abdelnur
30 *
31 */
32 public class SyndContentImpl extends ObjectBean implements SyndContent {
33 private String _type;
34 private String _value;
35
36
37 /***
38 * For implementations extending SyndContentImpl to be able to use the ObjectBean functionality
39 * with extended interfaces.
40 * <p>
41 * @param beanClass
42 */
43 protected SyndContentImpl(Class beanClass) {
44 super(beanClass);
45 }
46
47 /***
48 * Default constructor. All properties are set to <b>null</b>.
49 * <p>
50 *
51 */
52 public SyndContentImpl() {
53 this(SyndContent.class);
54 }
55
56 /***
57 * Returns the content type.
58 * <p>
59 * When used for the description of an entry, if <b>null</b> 'text/plain' must be assumed.
60 * <p>
61 * @return the content type, <b>null</b> if none.
62 *
63 */
64 public String getType() {
65 return _type;
66 }
67
68 /***
69 * Sets the content type.
70 * <p>
71 * When used for the description of an entry, if <b>null</b> 'text/plain' must be assumed.
72 * <p>
73 * @param type the content type to set, <b>null</b> if none.
74 *
75 */
76 public void setType(String type) {
77 _type = type;
78 }
79
80 /***
81 * Returns the content value.
82 * <p>
83 * @return the content value, <b>null</b> if none.
84 *
85 */
86 public String getValue() {
87 return _value;
88 }
89
90 /***
91 * Sets the content value.
92 * <p>
93 * @param value the content value to set, <b>null</b> if none.
94 *
95 */
96 public void setValue(String value) {
97 _value = value;
98 }
99
100
101 public Class getInterface() {
102 return SyndContent.class;
103 }
104
105 public void copyFrom(Object obj) {
106 COPY_FROM_HELPER.copy(this,obj);
107 }
108
109 private static final CopyFromHelper COPY_FROM_HELPER;
110
111 static {
112 Map basePropInterfaceMap = new HashMap();
113 basePropInterfaceMap.put("type",String.class);
114 basePropInterfaceMap.put("value",String.class);
115
116 Map basePropClassImplMap = Collections.EMPTY_MAP;
117
118 COPY_FROM_HELPER = new CopyFromHelper(SyndContent.class,basePropInterfaceMap,basePropClassImplMap);
119 }
120
121 }