001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.bean.html5; 018 019import org.apache.juneau.marshall.*; 020 021/** 022 * DTO for an HTML <a class="doclink" href="https://www.w3.org/TR/html5/grouping-content.html#the-dl-element"><dl></a> 023 * element. 024 * 025 * <p> 026 * The dl element represents a description list (also known as a definition list or association list). 027 * It is used to group terms (dt elements) with their descriptions (dd elements), creating a list 028 * of term-description pairs. The dl element is commonly used for glossaries, metadata lists, or 029 * any other content where you need to associate terms with their definitions or descriptions. 030 * 031 * <h5 class='section'>Examples:</h5> 032 * <p class='bcode w800'> 033 * <jk>import static</jk> org.apache.juneau.bean.html5.HtmlBuilder.*; 034 * 035 * <jc>// Simple description list</jc> 036 * Dl <jv>simple</jv> = <jsm>dl</jsm>( 037 * <jsm>dt</jsm>(<js>"HTML"</js>), 038 * <jsm>dd</jsm>(<js>"HyperText Markup Language"</js>), 039 * <jsm>dt</jsm>(<js>"CSS"</js>), 040 * <jsm>dd</jsm>(<js>"Cascading Style Sheets"</js>) 041 * ); 042 * 043 * <jc>// Description list with styling</jc> 044 * Dl <jv>styled</jv> = <jsm>dl</jsm>( 045 * <jsm>dt</jsm>(<js>"API"</js>), 046 * <jsm>dd</jsm>(<js>"Application Programming Interface"</js>), 047 * <jsm>dt</jsm>(<js>"DOM"</js>), 048 * <jsm>dd</jsm>(<js>"Document Object Model"</js>) 049 * ).class_(<js>"glossary"</js>); 050 * 051 * <jc>// Description list with multiple descriptions</jc> 052 * Dl <jv>multiple</jv> = <jsm>dl</jsm>( 053 * <jsm>dt</jsm>(<js>"JavaScript"</js>), 054 * <jsm>dd</jsm>(<js>"A programming language for web development."</js>), 055 * <jsm>dd</jsm>(<js>"It runs in web browsers and on servers."</js>), 056 * <jsm>dt</jsm>(<js>"Python"</js>), 057 * <jsm>dd</jsm>(<js>"A high-level programming language."</js>), 058 * <jsm>dd</jsm>(<js>"Known for its simplicity and readability."</js>) 059 * ); 060 * 061 * <jc>// Description list with complex content</jc> 062 * Dl <jv>complex</jv> = <jsm>dl</jsm>( 063 * <jsm>dt</jsm>(<js>"Web Standards"</js>), 064 * <jsm>dd</jsm>( 065 * <js>"Standards developed by the "</js>, 066 * <jsm>a</jsm>(<js>"https://w3.org"</js>, <js>"W3C"</js>), 067 * <js>" to ensure web compatibility."</js> 068 * ), 069 * <jsm>dt</jsm>(<js>"Responsive Design"</js>), 070 * <jsm>dd</jsm>( 071 * <js>"Design approach that adapts to different "</js>, 072 * <jsm>strong</jsm>(<js>"screen sizes"</js>), 073 * <js>" and devices."</js> 074 * ) 075 * ); 076 * 077 * <jc>// Description list with ID</jc> 078 * Dl <jv>withId</jv> = <jsm>dl</jsm>( 079 * <jsm>dt</jsm>(<js>"Framework"</js>), 080 * <jsm>dd</jsm>(<js>"A collection of pre-written code for common tasks."</js>), 081 * <jsm>dt</jsm>(<js>"Library"</js>), 082 * <jsm>dd</jsm>(<js>"A collection of reusable code modules."</js>) 083 * ).id(<js>"tech-terms"</js>); 084 * 085 * <jc>// Description list with styling</jc> 086 * Dl <jv>styled2</jv> = <jsm>dl</jsm>( 087 * <jsm>dt</jsm>(<js>"Frontend"</js>), 088 * <jsm>dd</jsm>(<js>"The client-side part of a web application."</js>), 089 * <jsm>dt</jsm>(<js>"Backend"</js>), 090 * <jsm>dd</jsm>(<js>"The server-side part of a web application."</js>) 091 * ).style(<js>"border: 1px solid #ccc; padding: 10px;"</js>); 092 * </p> 093 * 094 * <p> 095 * The following convenience methods are provided for constructing instances of this bean: 096 * <ul class='javatree'> 097 * <li class='jc'>{@link HtmlBuilder} 098 * <ul class='javatree'> 099 * <li class='jm'>{@link HtmlBuilder#dl() dl()} 100 * <li class='jm'>{@link HtmlBuilder#dl(Object...) dl(Object...)} 101 * </ul> 102 * </ul> 103 * </p> 104 * 105 * <h5 class='section'>See Also:</h5><ul> 106 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanHtml5">juneau-bean-html5</a> 107 * </ul> 108 */ 109@Marshalled(typeName = "dl") 110public class Dl extends HtmlElementContainer<Dl> { 111 112 /** 113 * Creates an empty {@link Dl} element. 114 */ 115 public Dl() {} 116 117 /** 118 * Creates a {@link Dl} element with the specified child nodes. 119 * 120 * @param children The child nodes. 121 */ 122 public Dl(Object...children) { 123 children(children); 124 } 125 126}