001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.dto.atom;
014
015import java.util.*;
016
017import org.apache.juneau.annotation.*;
018
019/**
020 * Represents an <code>atomSource</code> construct in the RFC4287 specification.
021 *
022 * <h5 class='figure'>Schema</h5>
023 * <p class='bcode w800'>
024 *    atomSource =
025 *       element atom:source {
026 *          atomCommonAttributes,
027 *          (atomAuthor*
028 *          &amp; atomCategory*
029 *          &amp; atomContributor*
030 *          &amp; atomGenerator?
031 *          &amp; atomIcon?
032 *          &amp; atomId?
033 *          &amp; atomLink*
034 *          &amp; atomLogo?
035 *          &amp; atomRights?
036 *          &amp; atomSubtitle?
037 *          &amp; atomTitle?
038 *          &amp; atomUpdated?
039 *          &amp; extensionElement*)
040 *       }
041 * </p>
042 *
043 * <h5 class='section'>See Also:</h5>
044 * <ul class='doctree'>
045 *    <li class='link'>{@doc juneau-dto.Atom}
046 *    <li class='jp'>{@doc package-summary.html#TOC}
047 * </ul>
048 */
049public class Source extends CommonEntry {
050
051   private Generator generator;
052   private Icon icon;
053   private Logo logo;
054   private Text subtitle;
055
056
057   //-----------------------------------------------------------------------------------------------------------------
058   // Bean properties
059   //-----------------------------------------------------------------------------------------------------------------
060
061   /**
062    * Returns the generator info of this source.
063    *
064    * @return The generator info of this source.
065    */
066   public Generator getGenerator() {
067      return generator;
068   }
069
070   /**
071    * Sets the generator info of this source.
072    *
073    * @param generator The generator info of this source.
074    * @return This object (for method chaining).
075    */
076   @BeanProperty("generator")
077   public Source generator(Generator generator) {
078      this.generator = generator;
079      return this;
080   }
081
082   /**
083    * Returns the icon of this source.
084    *
085    * @return The icon of this source.
086    */
087   public Icon getIcon() {
088      return icon;
089   }
090
091   /**
092    * Sets the icon of this source.
093    *
094    * @param icon The icon of this source.
095    * @return This object (for method chaining).
096    */
097   @BeanProperty("icon")
098   public Source icon(Icon icon) {
099      this.icon = icon;
100      return this;
101   }
102
103   /**
104    * Returns the logo of this source.
105    *
106    * @return The logo of this source.
107    */
108   public Logo getLogo() {
109      return logo;
110   }
111
112   /**
113    * Sets the logo of this source.
114    *
115    * @param logo The logo of this source.
116    * @return This object (for method chaining).
117    */
118   @BeanProperty("logo")
119   public Source logo(Logo logo) {
120      this.logo = logo;
121      return this;
122   }
123
124   /**
125    * Returns the subtitle of this source.
126    *
127    * @return The subtitle of this source.
128    */
129   public Text getSubtitle() {
130      return subtitle;
131   }
132
133   /**
134    * Sets the subtitle of this source.
135    *
136    * @param subtitle The subtitle of this source.
137    * @return This object (for method chaining).
138    */
139   @BeanProperty("subtitle")
140   public Source subtitle(Text subtitle) {
141      this.subtitle = subtitle;
142      return this;
143   }
144
145   /**
146    * Sets the subtitle of this source.
147    *
148    * @param subtitle The subtitle of this source.
149    * @return This object (for method chaining).
150    */
151   @BeanProperty("subtitle")
152   public Source subtitle(String subtitle) {
153      this.subtitle = new Text(subtitle);
154      return this;
155   }
156
157
158   //-----------------------------------------------------------------------------------------------------------------
159   // Overridden setters (to simplify method chaining)
160   //-----------------------------------------------------------------------------------------------------------------
161
162   @Override /* CommonEntry */
163   public Source authors(Person...authors) {
164      super.authors(authors);
165      return this;
166   }
167
168   @Override /* CommonEntry */
169   public Source categories(Category...categories) {
170      super.categories(categories);
171      return this;
172   }
173
174   @Override /* CommonEntry */
175   public Source contributors(Person...contributors) {
176      super.contributors(contributors);
177      return this;
178   }
179
180   @Override /* CommonEntry */
181   public Source id(Id id) {
182      super.id(id);
183      return this;
184   }
185
186   @Override /* CommonEntry */
187   public Source links(Link...links) {
188      super.links(links);
189      return this;
190   }
191
192   @Override /* CommonEntry */
193   public Source rights(Text rights) {
194      super.rights(rights);
195      return this;
196   }
197
198   @Override /* CommonEntry */
199   public Source rights(String rights) {
200      super.rights(rights);
201      return this;
202   }
203
204   @Override /* CommonEntry */
205   public Source title(Text title) {
206      super.title(title);
207      return this;
208   }
209
210   @Override /* CommonEntry */
211   public Source title(String title) {
212      super.title(title);
213      return this;
214   }
215
216   @Override /* CommonEntry */
217   public Source updated(Calendar updated) {
218      super.updated(updated);
219      return this;
220   }
221
222   @Override /* CommonEntry */
223   public Source updated(String updated) {
224      super.updated(updated);
225      return this;
226   }
227
228   @Override /* Common */
229   public Source base(Object base) {
230      super.base(base);
231      return this;
232   }
233
234   @Override /* Common */
235   public Source lang(String lang) {
236      super.lang(lang);
237      return this;
238   }
239}