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