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