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-figcaption-element"><figcaption></a> 023 * element. 024 * 025 * <p> 026 * The figcaption element represents a caption or legend for a figure. It is used to provide a 027 * caption for the content of its parent figure element, such as images, diagrams, code snippets, 028 * or other self-contained content. The figcaption element can be placed either before or after 029 * the figure content and is typically used to provide context, attribution, or explanation for 030 * the figure. 031 * 032 * <h5 class='section'>Examples:</h5> 033 * <p class='bcode w800'> 034 * <jk>import static</jk> org.apache.juneau.bean.html5.HtmlBuilder.*; 035 * 036 * <jc>// Simple figure caption</jc> 037 * Figcaption <jv>simple</jv> = <jsm>figcaption</jsm>(<js>"A beautiful sunset over the mountains."</js>); 038 * 039 * <jc>// Figure caption with styling</jc> 040 * Figcaption <jv>styled</jv> = <jsm>figcaption</jsm>(<js>"Chart showing sales data for Q1 2024."</js>) 041 * .class_(<js>"image-caption"</js>); 042 * 043 * <jc>// Figure caption with complex content</jc> 044 * Figcaption <jv>complex</jv> = <jsm>figcaption</jsm>( 045 * <js>"Figure 1: "</js>, 046 * <jsm>strong</jsm>(<js>"Web Development Process"</js>), 047 * <js>" - A step-by-step guide to building websites."</js> 048 * ); 049 * 050 * <jc>// Figure caption with links</jc> 051 * Figcaption <jv>withLinks</jv> = <jsm>figcaption</jsm>( 052 * <js>"Source: "</js>, 053 * <jsm>a</jsm>(<js>"/data"</js>, <js>"Company Data"</js>), 054 * <js>" | "</js>, 055 * <jsm>a</jsm>(<js>"/methodology"</js>, <js>"Methodology"</js>) 056 * ); 057 * 058 * <jc>// Figure caption with ID</jc> 059 * Figcaption <jv>withId</jv> = <jsm>figcaption</jsm>(<js>"Interactive chart showing user engagement metrics."</js>) 060 * .id(<js>"chart-caption"</js>); 061 * 062 * <jc>// Figure caption with styling</jc> 063 * Figcaption <jv>styled2</jv> = <jsm>figcaption</jsm>(<js>"Photograph by John Doe, 2024"</js>) 064 * .style(<js>"text-align: center; font-style: italic; color: #666;"</js>); 065 * 066 * <jc>// Figure caption with multiple elements</jc> 067 * Figcaption <jv>multiple</jv> = <jsm>figcaption</jsm>( 068 * <js>"Code Example: "</js>, 069 * <jsm>code</jsm>(<js>"function hello() { return 'Hello World'; }"</js>), 070 * <js>" - A simple JavaScript function."</js> 071 * ); 072 * </p> 073 * 074 * <p> 075 * The following convenience methods are provided for constructing instances of this bean: 076 * <ul class='javatree'> 077 * <li class='jc'>{@link HtmlBuilder} 078 * <ul class='javatree'> 079 * <li class='jm'>{@link HtmlBuilder#figcaption() figcaption()} 080 * <li class='jm'>{@link HtmlBuilder#figcaption(Object...) figcaption(Object...)} 081 * </ul> 082 * </ul> 083 * </p> 084 * 085 * <h5 class='section'>See Also:</h5><ul> 086 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanHtml5">juneau-bean-html5</a> 087 * </ul> 088 */ 089@Marshalled(typeName = "figcaption") 090public class Figcaption extends HtmlElementMixed<Figcaption> { 091 092 /** 093 * Creates an empty {@link Figcaption} element. 094 */ 095 public Figcaption() {} 096 097 /** 098 * Creates a {@link Figcaption} element with the specified child nodes. 099 * 100 * @param children The child nodes. 101 */ 102 public Figcaption(Object...children) { 103 children(children); 104 } 105 106}