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-source-element <source>}
023 * element.
024 *
025 * <h5 class='section'>See Also:</h5>
026 * <ul class='doctree'>
027 *    <li class='link'>{@doc juneau-dto.HTML5}
028 * </ul>
029 */
030@Bean(typeName="source")
031public class Source extends HtmlElementVoid {
032
033   /**
034    * {@doc HTML5.embedded-content-0#attr-source-src src} attribute.
035    *
036    * <p>
037    * Address of the resource.
038    *
039    * <p>
040    * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}.
041    * Strings must be valid URIs.
042    *
043    * <p>
044    * URIs defined by {@link UriResolver} can be used for values.
045    *
046    * @param src
047    *    The new value for this attribute.
048    *    Typically a {@link URL} or {@link String}.
049    * @return This object (for method chaining).
050    */
051   public final Source src(Object src) {
052      attrUri("src", src);
053      return this;
054   }
055
056   /**
057    * {@doc HTML5.embedded-content-0#attr-source-type type} attribute.
058    *
059    * <p>
060    * Type of embedded resource.
061    *
062    * @param type The new value for this attribute.
063    * @return This object (for method chaining).
064    */
065   public final Source type(String type) {
066      attr("type", type);
067      return this;
068   }
069
070
071   //-----------------------------------------------------------------------------------------------------------------
072   // Overridden methods
073   //-----------------------------------------------------------------------------------------------------------------
074
075   @Override /* HtmlElement */
076   public final Source _class(String _class) {
077      super._class(_class);
078      return this;
079   }
080
081   @Override /* HtmlElement */
082   public final Source id(String id) {
083      super.id(id);
084      return this;
085   }
086}