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.atom;
18  
19  import com.sun.syndication.common.ObjectBean;
20  import com.sun.syndication.common.Enum;
21  
22  /***
23   * Bean for link elements of Atom feeds.
24   * <p>
25   * @author Alejandro Abdelnur
26   *
27   */
28  public class Link extends ObjectBean {
29  
30      /***
31       * Enumeration type for the 'rel' property of Atom Link elements.
32       * <p>
33       * @author Alejandro Abdelnur
34       *
35       */
36      public static class Rel extends Enum {
37  
38          private Rel(String name) {
39              super(name);
40          }
41  
42      }
43  
44      public static final Rel ALTERNATE = new Rel("alternate");
45      public static final Rel START = new Rel("start");
46      public static final Rel NEXT = new Rel("next");
47      public static final Rel PREV = new Rel("prev");
48      public static final Rel SERVICE_EDIT = new Rel("service.edit");
49      public static final Rel SERVICE_POST = new Rel("service.post");
50      public static final Rel SERVICE_FEED = new Rel("service.feed");
51  
52      private Rel _rel;
53      private String _type;
54      private String _href;
55      private String _title;
56  
57      /***
58       * Default constructor. All properties are set to <b>null</b>.
59       * <p>
60       *
61       */
62      public Link() {
63      }
64  
65      /***
66       * Returns the link rel.
67       * <p>
68       * @return the link rel, <b>null</b> if none.
69       *
70       */
71      public Rel getRel() {
72          return _rel;
73      }
74  
75      /***
76       * Sets the link rel.
77       * <p>
78       * @param rel the link rel,, <b>null</b> if none.
79       *
80       */
81      public void setRel(Rel rel) {
82          _rel = rel;
83      }
84  
85      /***
86       * Returns the link type.
87       * <p>
88       * @return the link type, <b>null</b> if none.
89       *
90       */
91      public String getType() {
92          return _type;
93      }
94  
95      /***
96       * Sets the link type.
97       * <p>
98       * @param type the link type, <b>null</b> if none.
99       *
100      */
101     public void setType(String type) {
102         _type = type;
103     }
104 
105     /***
106      * Returns the link href.
107      * <p>
108      * @return the link href, <b>null</b> if none.
109      *
110      */
111     public String getHref() {
112         return _href;
113     }
114 
115     /***
116      * Sets the link href.
117      * <p>
118      * @param href the link href, <b>null</b> if none.
119      *
120      */
121     public void setHref(String href) {
122         _href = href;
123     }
124 
125     /***
126      * Returns the link title.
127      * <p>
128      * @return the link title, <b>null</b> if none.
129      *
130      */
131     public String getTitle() {
132         return _title;
133     }
134 
135     /***
136      * Sets the link title.
137      * <p>
138      * @param title the link title, <b>null</b> if none.
139      *
140      */
141     public void setTitle(String title) {
142         _title = title;
143     }
144 
145 }