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 static org.apache.juneau.internal.StringUtils.*;
016import static org.apache.juneau.xml.annotation.XmlFormat.*;
017
018import java.net.*;
019import java.net.URI;
020
021import org.apache.juneau.*;
022import org.apache.juneau.annotation.*;
023import org.apache.juneau.xml.annotation.*;
024
025/**
026 * Represents an <code>atomLogo</code> construct in the RFC4287 specification.
027 *
028 * <h5 class='figure'>Schema</h5>
029 * <p class='bcode w800'>
030 *    atomLogo = element atom:logo {
031 *       atomCommonAttributes,
032 *       (atomUri)
033 *    }
034 * </p>
035 *
036 * <h5 class='section'>See Also:</h5>
037 * <ul class='doctree'>
038 *    <li class='link'>{@doc juneau-dto.Atom}
039 *    <li class='jp'>{@doc package-summary.html#TOC}
040 * </ul>
041 */
042@Bean(typeName="logo")
043public class Logo extends Common {
044
045   private URI uri;
046
047
048   /**
049    * Normal constructor.
050    *
051    * <p>
052    * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}.
053    * <br>Strings must be valid URIs.
054    *
055    * <p>
056    * URIs defined by {@link UriResolver} can be used for values.
057    *
058    * @param uri The URI of the logo.
059    */
060   public Logo(Object uri) {
061      uri(uri);
062   }
063
064   /** Bean constructor. */
065   public Logo() {}
066
067
068   //-----------------------------------------------------------------------------------------------------------------
069   // Bean properties
070   //-----------------------------------------------------------------------------------------------------------------
071
072   /**
073    * Returns the URI of the logo.
074    *
075    * @return The URI of the logo.
076    */
077   @Xml(format=ELEMENTS)
078   public URI getUri() {
079      return uri;
080   }
081
082   /**
083    * Sets the URI of the logo.
084    *
085    * <p>
086    * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}.
087    * <br>Strings must be valid URIs.
088    *
089    * <p>
090    * URIs defined by {@link UriResolver} can be used for values.
091    *
092    * @param uri The URI of the logo.
093    * @return This object (for method chaining).
094    */
095   @BeanProperty("uri")
096   public Logo uri(Object uri) {
097      this.uri = toURI(uri);
098      return this;
099   }
100
101
102   //-----------------------------------------------------------------------------------------------------------------
103   // Overridden setters (to simplify method chaining)
104   //-----------------------------------------------------------------------------------------------------------------
105
106   @Override /* Common */
107   public Logo base(Object base) {
108      super.base(base);
109      return this;
110   }
111
112   @Override /* Common */
113   public Logo lang(String lang) {
114      super.lang(lang);
115      return this;
116   }
117}