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 <c>atomSource</c> 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 * & atomCategory* 029 * & atomContributor* 030 * & atomGenerator? 031 * & atomIcon? 032 * & atomId? 033 * & atomLink* 034 * & atomLogo? 035 * & atomRights? 036 * & atomSubtitle? 037 * & atomTitle? 038 * & atomUpdated? 039 * & extensionElement*) 040 * } 041 * </p> 042 * 043 * <ul class='seealso'> 044 * <li class='link'>{@doc DtoAtom} 045 * <li class='jp'>{@doc package-summary.html#TOC} 046 * </ul> 047 */ 048public class Source extends CommonEntry { 049 050 private Generator generator; 051 private Icon icon; 052 private Logo logo; 053 private Text subtitle; 054 055 056 //----------------------------------------------------------------------------------------------------------------- 057 // Bean properties 058 //----------------------------------------------------------------------------------------------------------------- 059 060 /** 061 * Returns the generator info of this source. 062 * 063 * @return The generator info of this source. 064 */ 065 public Generator getGenerator() { 066 return generator; 067 } 068 069 /** 070 * Sets the generator info of this source. 071 * 072 * @param generator The generator info of this source. 073 * @return This object (for method chaining). 074 */ 075 @Beanp("generator") 076 public Source generator(Generator generator) { 077 this.generator = generator; 078 return this; 079 } 080 081 /** 082 * Returns the icon of this source. 083 * 084 * @return The icon of this source. 085 */ 086 public Icon getIcon() { 087 return icon; 088 } 089 090 /** 091 * Sets the icon of this source. 092 * 093 * @param icon The icon of this source. 094 * @return This object (for method chaining). 095 */ 096 @Beanp("icon") 097 public Source icon(Icon icon) { 098 this.icon = icon; 099 return this; 100 } 101 102 /** 103 * Returns the logo of this source. 104 * 105 * @return The logo of this source. 106 */ 107 public Logo getLogo() { 108 return logo; 109 } 110 111 /** 112 * Sets the logo of this source. 113 * 114 * @param logo The logo of this source. 115 * @return This object (for method chaining). 116 */ 117 @Beanp("logo") 118 public Source logo(Logo logo) { 119 this.logo = logo; 120 return this; 121 } 122 123 /** 124 * Returns the subtitle of this source. 125 * 126 * @return The subtitle of this source. 127 */ 128 public Text getSubtitle() { 129 return subtitle; 130 } 131 132 /** 133 * Sets the subtitle of this source. 134 * 135 * @param subtitle The subtitle of this source. 136 * @return This object (for method chaining). 137 */ 138 @Beanp("subtitle") 139 public Source subtitle(Text subtitle) { 140 this.subtitle = subtitle; 141 return this; 142 } 143 144 /** 145 * Sets the subtitle of this source. 146 * 147 * @param subtitle The subtitle of this source. 148 * @return This object (for method chaining). 149 */ 150 @Beanp("subtitle") 151 public Source subtitle(String subtitle) { 152 this.subtitle = new Text(subtitle); 153 return this; 154 } 155 156 157 //----------------------------------------------------------------------------------------------------------------- 158 // Overridden setters (to simplify method chaining) 159 //----------------------------------------------------------------------------------------------------------------- 160 161 @Override /* CommonEntry */ 162 public Source authors(Person...authors) { 163 super.authors(authors); 164 return this; 165 } 166 167 @Override /* CommonEntry */ 168 public Source categories(Category...categories) { 169 super.categories(categories); 170 return this; 171 } 172 173 @Override /* CommonEntry */ 174 public Source contributors(Person...contributors) { 175 super.contributors(contributors); 176 return this; 177 } 178 179 @Override /* CommonEntry */ 180 public Source id(Id id) { 181 super.id(id); 182 return this; 183 } 184 185 @Override /* CommonEntry */ 186 public Source links(Link...links) { 187 super.links(links); 188 return this; 189 } 190 191 @Override /* CommonEntry */ 192 public Source rights(Text rights) { 193 super.rights(rights); 194 return this; 195 } 196 197 @Override /* CommonEntry */ 198 public Source rights(String rights) { 199 super.rights(rights); 200 return this; 201 } 202 203 @Override /* CommonEntry */ 204 public Source title(Text title) { 205 super.title(title); 206 return this; 207 } 208 209 @Override /* CommonEntry */ 210 public Source title(String title) { 211 super.title(title); 212 return this; 213 } 214 215 @Override /* CommonEntry */ 216 public Source updated(Calendar updated) { 217 super.updated(updated); 218 return this; 219 } 220 221 @Override /* CommonEntry */ 222 public Source updated(String updated) { 223 super.updated(updated); 224 return this; 225 } 226 227 @Override /* Common */ 228 public Source base(Object base) { 229 super.base(base); 230 return this; 231 } 232 233 @Override /* Common */ 234 public Source lang(String lang) { 235 super.lang(lang); 236 return this; 237 } 238}