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-embed-element <embed>}
023 * element.
024 *
025 * <ul class='seealso'>
026 *    <li class='link'>{@doc juneau-dto.HTML5}
027 * </ul>
028 */
029@Bean(typeName="embed")
030public class Embed extends HtmlElementVoid {
031
032   /**
033    * {@doc HTML5.embedded-content-0#attr-dim-height height}
034    * attribute.
035    *
036    * <p>
037    * Vertical dimension.
038    *
039    * @param height
040    *    The new value for this attribute.
041    *    Typically a {@link Number} or {@link String}.
042    * @return This object (for method chaining).
043    */
044   public final Embed height(Object height) {
045      attr("height", height);
046      return this;
047   }
048
049   /**
050    * {@doc HTML5.embedded-content-0#attr-embed-src src} attribute.
051    *
052    * <p>
053    * Address of the resource.
054    *
055    * <p>
056    * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}.
057    * Strings must be valid URIs.
058    *
059    * <p>
060    * URIs defined by {@link UriResolver} can be used for values.
061    *
062    * @param src
063    *    The new value for this attribute.
064    *    Typically a {@link URL} or {@link String}.
065    * @return This object (for method chaining).
066    */
067   public final Embed src(Object src) {
068      attrUri("src", src);
069      return this;
070   }
071
072   /**
073    * {@doc HTML5.embedded-content-0#attr-embed-type type} attribute.
074    *
075    * <p>
076    * Type of embedded resource.
077    *
078    * @param type The new value for this attribute.
079    * @return This object (for method chaining).
080    */
081   public final Embed type(String type) {
082      attr("type", type);
083      return this;
084   }
085
086   /**
087    * {@doc HTML5.embedded-content-0#attr-dim-width width} attribute.
088    *
089    * <p>
090    * Horizontal dimension.
091    *
092    * @param width
093    *    The new value for this attribute.
094    *    Typically a {@link Number} or {@link String}.
095    * @return This object (for method chaining).
096    */
097   public final Embed width(Object width) {
098      attr("width", width);
099      return this;
100   }
101
102
103   //-----------------------------------------------------------------------------------------------------------------
104   // Overridden methods
105   //-----------------------------------------------------------------------------------------------------------------
106
107   @Override /* HtmlElement */
108   public final Embed _class(String _class) {
109      super._class(_class);
110      return this;
111   }
112
113   @Override /* HtmlElement */
114   public final Embed id(String id) {
115      super.id(id);
116      return this;
117   }
118
119   @Override /* HtmlElement */
120   public final Embed style(String style) {
121      super.style(style);
122      return this;
123   }
124}