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.html5; 014 015import java.net.*; 016import java.net.URI; 017 018import org.apache.juneau.*; 019import org.apache.juneau.annotation.*; 020 021/** 022 * DTO for an HTML <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#the-area-element"><area></a> 023 * element. 024 * 025 * <h5 class='section'>See Also:</h5> 026 * <ul class='doctree'> 027 * <li class='link'><a class='doclink' href='../../../../../overview-summary.html#juneau-dto.HTML5'>Overview > juneau-dto > HTML5</a> 028 * </ul> 029 */ 030@Bean(typeName="area") 031public class Area extends HtmlElementVoid { 032 033 /** 034 * <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-area-alt">alt</a> attribute. 035 * 036 * <p> 037 * Replacement text for use when images are not available. 038 * 039 * @param alt The new value for this attribute. 040 * @return This object (for method chaining). 041 */ 042 public final Area alt(String alt) { 043 attr("alt", alt); 044 return this; 045 } 046 047 /** 048 * <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-area-coords">coords</a> 049 * attribute. 050 * 051 * <p> 052 * Coordinates for the shape to be created in an image map. 053 * 054 * @param coords The new value for this attribute. 055 * @return This object (for method chaining). 056 */ 057 public final Area coords(String coords) { 058 attr("coords", coords); 059 return this; 060 } 061 062 /** 063 * <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-download">download</a> attribute. 064 * 065 * <p> 066 * Whether to download the resource instead of navigating to it, and its file name if so. 067 * 068 * @param download 069 * The new value for this attribute. 070 * Typically a {@link Boolean} or {@link String}. 071 * @return This object (for method chaining). 072 */ 073 public final Area download(Object download) { 074 attr("download", download); 075 return this; 076 } 077 078 /** 079 * <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-href">href</a> attribute. 080 * 081 * <p> 082 * Address of the hyperlink. 083 * 084 * <p> 085 * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}. 086 * Strings must be valid URIs. 087 * 088 * <p> 089 * URIs defined by {@link UriResolver} can be used for values. 090 * 091 * @param href 092 * The new value for this attribute. 093 * Typically a {@link URL} or {@link String}. 094 * @return This object (for method chaining). 095 */ 096 public final Area href(Object href) { 097 attrUri("href", href); 098 return this; 099 } 100 101 /** 102 * <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-hreflang">hreflang</a> attribute. 103 * 104 * <p> 105 * Language of the linked resource. 106 * 107 * @param hreflang The new value for this attribute. 108 * @return This object (for method chaining). 109 */ 110 public final Area hreflang(String hreflang) { 111 attr("hreflang", hreflang); 112 return this; 113 } 114 115 /** 116 * <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-rel">rel</a> attribute. 117 * 118 * <p> 119 * Relationship between the document containing the hyperlink and the destination resource. 120 * 121 * @param rel The new value for this attribute. 122 * @return This object (for method chaining). 123 */ 124 public final Area rel(String rel) { 125 attr("rel", rel); 126 return this; 127 } 128 129 /** 130 * <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-area-shape">shape</a> attribute. 131 * 132 * <p> 133 * The kind of shape to be created in an image map. 134 * 135 * @param shape The new value for this attribute. 136 * @return This object (for method chaining). 137 */ 138 public final Area shape(String shape) { 139 attr("shape", shape); 140 return this; 141 } 142 143 /** 144 * <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-target">target</a> attribute. 145 * 146 * <p> 147 * Browsing context for hyperlink navigation. 148 * 149 * @param target The new value for this attribute. 150 * @return This object (for method chaining). 151 */ 152 public final Area target(String target) { 153 attr("target", target); 154 return this; 155 } 156 157 /** 158 * <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-type">type</a> attribute. 159 * 160 * <p> 161 * Hint for the type of the referenced resource. 162 * 163 * @param type The new value for this attribute. 164 * @return This object (for method chaining). 165 */ 166 public final Area type(String type) { 167 attr("type", type); 168 return this; 169 } 170 171 172 //-------------------------------------------------------------------------------- 173 // Overridden methods 174 //-------------------------------------------------------------------------------- 175 176 @Override /* HtmlElement */ 177 public final Area _class(String _class) { 178 super._class(_class); 179 return this; 180 } 181 182 @Override /* HtmlElement */ 183 public final Area id(String id) { 184 super.id(id); 185 return this; 186 } 187 188 @Override /* HtmlElement */ 189 public final Area style(String style) { 190 super.style(style); 191 return this; 192 } 193}