View Javadoc

1   /*
2    * Copyright 2004 Sun Microsystems, Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   */
17  package com.sun.syndication.feed.module;
18  
19  import com.sun.syndication.common.ObjectBean;
20  import com.sun.syndication.feed.synd.impl.SyndCopyFrom;
21  
22  import java.util.Collections;
23  import java.util.HashMap;
24  import java.util.Map;
25  
26  /***
27   * Subject of the Dublin Core Module, default implementation.
28   * <p>
29   * @see <a href="http://web.resource.org/rss/1.0/modules/dc/">Dublin Core module</a>.
30   * @author Alejandro Abdelnur
31   *
32   */
33  public class DCSubject extends ObjectBean implements DCSubjectI {
34      private String _taxonomyUri;
35      private String _value;
36  
37      /***
38       * Default constructor. All properties are set to <b>null</b>.
39       * <p>
40       *
41       */
42      public DCSubject() {
43          super(DCSubjectI.class);
44      }
45  
46      /***
47       * Returns the DublinCore subject taxonomy URI.
48       * <p>
49       * @return the DublinCore subject taxonomy URI, <b>null</b> if none.
50       *
51       */
52      public String getTaxonomyUri() {
53          return _taxonomyUri;
54      }
55  
56      /***
57       * Sets the DublinCore subject taxonomy URI.
58       * <p>
59       * @param taxonomyUri the DublinCore subject taxonomy URI to set, <b>null</b> if none.
60       *
61       */
62      public void setTaxonomyUri(String taxonomyUri) {
63          _taxonomyUri = taxonomyUri;
64      }
65  
66      /***
67       * Returns the DublinCore subject value.
68       * <p>
69       * @return the DublinCore subject value, <b>null</b> if none.
70       *
71       */
72      public String getValue() {
73          return _value;
74      }
75  
76      /***
77       * Sets the DublinCore subject value.
78       * <p>
79       * @param value the DublinCore subject value to set, <b>null</b> if none.
80       *
81       */
82      public void setValue(String value) {
83          _value = value;
84      }
85  
86      public Class getInterface() {
87          return DCSubjectI.class;
88      }
89  
90      public void copyFrom(Object obj) {
91          SYND_COPY_FROM.copy(this,obj);
92      }
93  
94      private static final SyndCopyFrom SYND_COPY_FROM;
95  
96      static {
97          Map basePropInterfaceMap = new HashMap();
98          basePropInterfaceMap.put("taxonomyUri",String.class);
99          basePropInterfaceMap.put("value",String.class);
100 
101         Map basePropClassImplMap = Collections.EMPTY_MAP;
102 
103         SYND_COPY_FROM = new SyndCopyFrom(DCSubjectI.class,basePropInterfaceMap,basePropClassImplMap);
104     }
105 
106 }