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.synd;
18  
19  import com.sun.syndication.common.ObjectBean;
20  import com.sun.syndication.feed.module.DCSubject;
21  import com.sun.syndication.feed.module.DCSubjectI;
22  
23  /***
24   * Bean for categories of SyndFeed feeds and entries.
25   * <p>
26   * @author Alejandro Abdelnur
27   *
28   */
29  public class SyndCategory extends ObjectBean implements SyndCategoryI {
30      private DCSubjectI _subject;
31  
32      /***
33       * Package private constructor, used by SyndCategoryListFacade.
34       * <p>
35       * @param subject the DC subject to wrap.
36       *
37       */
38      SyndCategory(DCSubjectI subject) {
39          super(SyndCategoryI.class);
40          _subject = subject;
41      }
42  
43      /***
44       * Package private constructor, used by SyndCategoryListFacade.
45       * <p>
46       * @return the DC subject being wrapped.
47       *
48       */
49      DCSubjectI getSubject() {
50          return _subject;
51      }
52  
53      /***
54       * Default constructor. All properties are set to <b>null</b>.
55       * <p>
56       *
57       */
58      public SyndCategory() {
59          this(new DCSubject());
60      }
61  
62      /***
63       * Returns the category name.
64       * <p>
65       * @return the category name, <b>null</b> if none.
66       *
67       */
68      public String getName() {
69          return _subject.getValue();
70      }
71  
72      /***
73       * Sets the category name.
74       * <p>
75       * @param name the category name to set, <b>null</b> if none.
76       *
77       */
78      public void setName(String name) {
79          _subject.setValue(name);
80      }
81  
82      /***
83       * Returns the category taxonomy URI.
84       * <p>
85       * @return the category taxonomy URI, <b>null</b> if none.
86       *
87       */
88      public String getTaxonomyUri() {
89          return _subject.getTaxonomyUri();
90      }
91  
92      /***
93       * Sets the category taxonomy URI.
94       * <p>
95       * @param taxonomyUri the category taxonomy URI to set, <b>null</b> if none.
96       *
97       */
98      public void setTaxonomyUri(String taxonomyUri) {
99          _subject.setTaxonomyUri(taxonomyUri);
100     }
101 
102 }