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