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.common.internal.StringUtils.*; 016import static org.apache.juneau.xml.annotation.XmlFormat.*; 017 018import java.net.*; 019 020import org.apache.juneau.*; 021import org.apache.juneau.annotation.*; 022import org.apache.juneau.internal.*; 023import org.apache.juneau.xml.annotation.*; 024 025/** 026 * Represents an <c>atomIcon</c> construct in the RFC4287 specification. 027 * 028 * <h5 class='figure'>Schema</h5> 029 * <p class='bschema'> 030 * atomIcon = element atom:icon { 031 * atomCommonAttributes, 032 * (atomUri) 033 * } 034 * </p> 035 * 036 * <h5 class='section'>See Also:</h5><ul> 037 * <li class='link'><a class="doclink" href="../../../../../index.html#jd.Atom">Overview > juneau-dto > Atom</a> 038 * </ul> 039 */ 040@Bean(typeName="icon") 041@FluentSetters 042public class Icon extends Common { 043 044 private URI uri; 045 046 047 /** 048 * Normal constructor. 049 * 050 * <p> 051 * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}. 052 * Strings must be valid URIs. 053 * 054 * <p> 055 * URIs defined by {@link UriResolver} can be used for values. 056 * 057 * @param uri The URI of the icon. 058 */ 059 public Icon(Object uri) { 060 setUri(uri); 061 } 062 063 /** Bean constructor. */ 064 public Icon() {} 065 066 067 //----------------------------------------------------------------------------------------------------------------- 068 // Bean properties 069 //----------------------------------------------------------------------------------------------------------------- 070 071 /** 072 * Bean property getter: <property>uri</property>. 073 * 074 * <p> 075 * The URI of this icon. 076 * 077 * @return The property value, or <jk>null</jk> if it is not set. 078 */ 079 @Xml(format=ELEMENTS) 080 public URI getUri() { 081 return uri; 082 } 083 084 /** 085 * Bean property setter: <property>uri</property>. 086 * 087 * <p> 088 * The URI of this icon. 089 * 090 * <p> 091 * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}. 092 * Strings must be valid URIs. 093 * 094 * @param value 095 * The new value for this property. 096 * <br>Can be <jk>null</jk> to unset the property. 097 * @return This object 098 */ 099 public Icon setUri(Object value) { 100 this.uri = toURI(value); 101 return this; 102 } 103 104 //----------------------------------------------------------------------------------------------------------------- 105 // Overridden setters (to simplify method chaining) 106 //----------------------------------------------------------------------------------------------------------------- 107 108 // <FluentSetters> 109 110 @Override /* GENERATED - org.apache.juneau.dto.atom.Common */ 111 public Icon setBase(Object value) { 112 super.setBase(value); 113 return this; 114 } 115 116 @Override /* GENERATED - org.apache.juneau.dto.atom.Common */ 117 public Icon setLang(String value) { 118 super.setLang(value); 119 return this; 120 } 121 122 // </FluentSetters> 123}