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/sections.html#the-aside-element"><aside></a> 023 * element. 024 * 025 * <p> 026 * The aside element represents a section of a page that consists of content that is tangentially 027 * related to the content around the aside element, and which could be considered separate from 028 * that content. It is commonly used for sidebars, pull quotes, advertisements, navigation links, 029 * or other content that is related but not essential to the main content. 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>// Sidebar with related links</jc> 036 * Aside <jv>sidebar</jv> = <jsm>aside</jsm>( 037 * <jsm>h3</jsm>(<js>"Related Articles"</js>), 038 * <jsm>ul</jsm>( 039 * <jsm>li</jsm>(<jsm>a</jsm>(<js>"/article1"</js>, <js>"Article 1"</js>)), 040 * <jsm>li</jsm>(<jsm>a</jsm>(<js>"/article2"</js>, <js>"Article 2"</js>)), 041 * <jsm>li</jsm>(<jsm>a</jsm>(<js>"/article3"</js>, <js>"Article 3"</js>)) 042 * ) 043 * ).class_(<js>"sidebar"</js>); 044 * 045 * <jc>// Pull quote</jc> 046 * Aside <jv>pullQuote</jv> = <jsm>aside</jsm>( 047 * <jsm>blockquote</jsm>( 048 * <js>"The best way to predict the future is to create it."</js>, 049 * <jsm>footer</jsm>(<js>"— Peter Drucker"</js>) 050 * ) 051 * ).class_(<js>"pull-quote"</js>); 052 * 053 * <jc>// Advertisement</jc> 054 * Aside <jv>advertisement</jv> = <jsm>aside</jsm>( 055 * <jsm>h4</jsm>(<js>"Sponsored Content"</js>), 056 * <jsm>p</jsm>(<js>"Check out our latest product!"</js>), 057 * <jsm>a</jsm>(<js>"/product"</js>, <js>"Learn More"</js>) 058 * ).class_(<js>"advertisement"</js>); 059 * 060 * <jc>// Author bio</jc> 061 * Aside <jv>authorBio</jv> = <jsm>aside</jsm>( 062 * <jsm>h3</jsm>(<js>"About the Author"</js>), 063 * <jsm>p</jsm>(<js>"John Doe is a web developer with 10 years of experience..."</js>), 064 * <jsm>a</jsm>(<js>"/author/john-doe"</js>, <js>"Read more articles"</js>) 065 * ).class_(<js>"author-bio"</js>); 066 * 067 * <jc>// Navigation menu</jc> 068 * Aside <jv>navigation</jv> = <jsm>aside</jsm>( 069 * <jsm>nav</jsm>( 070 * <jsm>ul</jsm>( 071 * <jsm>li</jsm>(<jsm>a</jsm>(<js>"/home"</js>, <js>"Home"</js>)), 072 * <jsm>li</jsm>(<jsm>a</jsm>(<js>"/about"</js>, <js>"About"</js>)), 073 * <jsm>li</jsm>(<jsm>a</jsm>(<js>"/contact"</js>, <js>"Contact"</js>)) 074 * ) 075 * ) 076 * ).class_(<js>"navigation"</js>); 077 * 078 * <jc>// Glossary or definitions</jc> 079 * Aside <jv>glossary</jv> = <jsm>aside</jsm>( 080 * <jsm>h3</jsm>(<js>"Key Terms"</js>), 081 * <jsm>dl</jsm>( 082 * <jsm>dt</jsm>(<js>"HTML"</js>), 083 * <jsm>dd</jsm>(<js>"HyperText Markup Language"</js>), 084 * <jsm>dt</jsm>(<js>"CSS"</js>), 085 * <jsm>dd</jsm>(<js>"Cascading Style Sheets"</js>) 086 * ) 087 * ).class_(<js>"glossary"</js>); 088 * </p> 089 * 090 * <p> 091 * The following convenience methods are provided for constructing instances of this bean: 092 * <ul class='javatree'> 093 * <li class='jc'>{@link HtmlBuilder} 094 * <ul class='javatree'> 095 * <li class='jm'>{@link HtmlBuilder#aside() aside()} 096 * <li class='jm'>{@link HtmlBuilder#aside(Object...) aside(Object...)} 097 * </ul> 098 * </ul> 099 * </p> 100 * 101 * <h5 class='section'>See Also:</h5><ul> 102 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanHtml5">juneau-bean-html5</a> 103 * </ul> 104 */ 105@Marshalled(typeName = "aside") 106public class Aside extends HtmlElementMixed<Aside> { 107 108 /** 109 * Creates an empty {@link Aside} element. 110 */ 111 public Aside() {} 112 113 /** 114 * Creates an {@link Aside} element with the specified child nodes. 115 * 116 * @param children The child nodes. 117 */ 118 public Aside(Object...children) { 119 children(children); 120 } 121 122}