001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.bean.atom; 018 019import static org.apache.juneau.commons.utils.StringUtils.*; 020import static org.apache.juneau.xml.annotation.XmlFormat.*; 021 022import java.net.*; 023 024import org.apache.juneau.*; 025import org.apache.juneau.annotation.*; 026import org.apache.juneau.xml.annotation.*; 027 028/** 029 * Represents a larger logo image for visual identification of a feed. 030 * 031 * <p> 032 * The logo element contains a URI reference to an image that provides visual identification 033 * for the feed. Logos are typically larger than icons and are suitable for display in feed 034 * readers, aggregators, and feed directories. 035 * 036 * <p> 037 * Per RFC 4287 recommendations: 038 * <ul class='spaced-list'> 039 * <li>Should have a 2:1 aspect ratio (twice as wide as tall) 040 * <li>Common formats: PNG, JPEG, GIF, SVG 041 * <li>Suitable for prominent display in feed readers 042 * </ul> 043 * 044 * <h5 class='figure'>Schema</h5> 045 * <p class='bschema'> 046 * atomLogo = element atom:logo { 047 * atomCommonAttributes, 048 * (atomUri) 049 * } 050 * </p> 051 * 052 * <h5 class='section'>Example:</h5> 053 * <p class='bjava'> 054 * Logo <jv>logo</jv> = <jk>new</jk> Logo(<js>"http://example.org/logo.png"</js>); 055 * 056 * Feed <jv>feed</jv> = <jk>new</jk> Feed(...) 057 * .setLogo(<jv>logo</jv>); 058 * </p> 059 * 060 * <h5 class='section'>Specification:</h5> 061 * <p> 062 * Represents an <c>atomLogo</c> construct in the 063 * <a class="doclink" href="https://tools.ietf.org/html/rfc4287#section-4.2.8">RFC 4287 - Section 4.2.8</a> specification. 064 * 065 * <h5 class='section'>See Also:</h5><ul> 066 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanAtom">juneau-bean-atom</a> 067 * <li class='extlink'><a class="doclink" href="https://tools.ietf.org/html/rfc4287">RFC 4287 - The Atom Syndication Format</a> 068 * </ul> 069 */ 070@Bean(typeName = "logo") 071public class Logo extends Common { 072 073 private URI uri; 074 075 /** Bean constructor. */ 076 public Logo() {} 077 078 /** 079 * Normal constructor. 080 * 081 * <p> 082 * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}. 083 * <br>Strings must be valid URIs. 084 * 085 * <p> 086 * URIs defined by {@link UriResolver} can be used for values. 087 * 088 * @param uri The URI of the logo. 089 */ 090 public Logo(Object uri) { 091 setUri(uri); 092 } 093 094 /** 095 * Bean property getter: <property>uri</property>. 096 * 097 * <p> 098 * The URI of the logo. 099 * 100 * @return The property value, or <jk>null</jk> if it is not set. 101 */ 102 @Xml(format = TEXT) 103 public URI getUri() { return uri; } 104 105 @Override /* Overridden from Common */ 106 public Logo setBase(Object value) { 107 super.setBase(value); 108 return this; 109 } 110 111 @Override /* Overridden from Common */ 112 public Logo setLang(String value) { 113 super.setLang(value); 114 return this; 115 } 116 117 /** 118 * Bean property setter: <property>uri</property>. 119 * 120 * <p> 121 * The URI of the logo. 122 * 123 * <p> 124 * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}. 125 * <br>Strings must be valid URIs. 126 * 127 * <p> 128 * URIs defined by {@link UriResolver} can be used for values. 129 * 130 * @param value 131 * The new value for this property. 132 * <br>Can be <jk>null</jk> to unset the property. 133 * @return This object 134 */ 135 public Logo setUri(Object value) { 136 this.uri = toUri(value); 137 return this; 138 } 139}