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