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-track-element <track>}
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="track")
031public class Track extends HtmlElementVoid {
032
033   /**
034    * {@doc HTML5.embedded-content-0#attr-track-default default}
035    * attribute.
036    *
037    * <p>
038    * Enable the track if no other text track is more suitable.
039    *
040    * @param _default The new value for this attribute.
041    * @return This object (for method chaining).
042    */
043   public final Track _default(String _default) {
044      attr("default", _default);
045      return this;
046   }
047
048   /**
049    * {@doc HTML5.embedded-content-0#attr-track-kind kind} attribute.
050    *
051    * <p>
052    * The type of text track.
053    *
054    * @param kind The new value for this attribute.
055    * @return This object (for method chaining).
056    */
057   public final Track kind(String kind) {
058      attr("kind", kind);
059      return this;
060   }
061
062   /**
063    * {@doc HTML5.embedded-content-0#attr-track-label label} attribute.
064    *
065    * <p>
066    * User-visible label.
067    *
068    * @param label The new value for this attribute.
069    * @return This object (for method chaining).
070    */
071   public final Track label(String label) {
072      attr("label", label);
073      return this;
074   }
075
076   /**
077    * {@doc HTML5.embedded-content-0#attr-track-src src} attribute.
078    *
079    * <p>
080    * Address of the resource.
081    *
082    * <p>
083    * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}.
084    * Strings must be valid URIs.
085    *
086    * <p>
087    * URIs defined by {@link UriResolver} can be used for values.
088    *
089    * @param src
090    *    The new value for this attribute.
091    *    Typically a {@link URL} or {@link String}.
092    * @return This object (for method chaining).
093    */
094   public final Track src(Object src) {
095      attrUri("src", src);
096      return this;
097   }
098
099   /**
100    * {@doc HTML5.embedded-content-0#attr-track-srclang srclang}
101    * attribute.
102    *
103    * <p>
104    * Language of the text track.
105    *
106    * @param srclang The new value for this attribute.
107    * @return This object (for method chaining).
108    */
109   public final Track srclang(String srclang) {
110      attr("srclang", srclang);
111      return this;
112   }
113
114
115   //-----------------------------------------------------------------------------------------------------------------
116   // Overridden methods
117   //-----------------------------------------------------------------------------------------------------------------
118
119   @Override /* HtmlElement */
120   public final Track _class(String _class) {
121      super._class(_class);
122      return this;
123   }
124
125   @Override /* HtmlElement */
126   public final Track id(String id) {
127      super.id(id);
128      return this;
129   }
130}