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/text-level-semantics.html#the-u-element"><u></a> 023 * element. 024 * 025 * <p> 026 * The u element represents a span of text with an unarticulated, though explicitly rendered, 027 * non-textual annotation. It is used to mark up text that should be underlined, such as 028 * proper names in Chinese text, misspelled words, or text that needs to be distinguished 029 * from the surrounding content. The u element is typically rendered with an underline and 030 * is commonly used for indicating proper names, misspellings, or other annotations. 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 underlined text</jc> 037 * U <jv>simple</jv> = <jsm>u</jsm>(<js>"This text is underlined"</js>); 038 * 039 * <jc>// U with styling</jc> 040 * U <jv>styled</jv> = <jsm>u</jsm>(<js>"Styled underlined text"</js>) 041 * .class_(<js>"underlined"</js>); 042 * 043 * <jc>// U with complex content</jc> 044 * U <jv>complex</jv> = <jsm>u</jsm>( 045 * <js>"The "</js>, 046 * <jsm>strong</jsm>(<js>"proper name"</js>), 047 * <js>" is underlined."</js> 048 * ); 049 * 050 * <jc>// U with ID</jc> 051 * U <jv>withId</jv> = <jsm>u</jsm>(<js>"Text with ID"</js>) 052 * .id(<js>"underlined-text"</js>); 053 * 054 * <jc>// U with styling</jc> 055 * U <jv>styled2</jv> = <jsm>u</jsm>(<js>"Custom underlined text"</js>) 056 * .style(<js>"color: #666; text-decoration: underline;"</js>) 057 * .children("Custom styled underlined text"); 058 * 059 * // U with multiple elements 060 * U multiple = u() 061 * .children( 062 * "The ", 063 * u().children("proper name"), 064 * " is ", 065 * u().children("underlined"), 066 * " for emphasis." 067 * ); 068 * 069 * // U with links 070 * U withLinks = u() 071 * .children( 072 * "See ", 073 * a().href("/help/underline").children("underline guide"), 074 * " for more information." 075 * ); 076 * </p> 077 * 078 * <p> 079 * The following convenience methods are provided for constructing instances of this bean: 080 * <ul class='javatree'> 081 * <li class='jc'>{@link HtmlBuilder} 082 * <ul class='javatree'> 083 * <li class='jm'>{@link HtmlBuilder#u() u()} 084 * <li class='jm'>{@link HtmlBuilder#u(Object...) u(Object...)} 085 * </ul> 086 * </ul> 087 * </p> 088 * 089 * <h5 class='section'>See Also:</h5><ul> 090 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanHtml5">juneau-bean-html5</a> 091 * </ul> 092 */ 093@Marshalled(typeName = "u") 094public class U extends HtmlElementMixed<U> { 095 096 /** 097 * Creates an empty {@link U} element. 098 */ 099 public U() {} 100 101 /** 102 * Creates a {@link U} element with the specified child nodes. 103 * 104 * @param children The child nodes. Must not be <jk>null</jk>. 105 */ 106 public U(Object...children) { 107 children(children); 108 } 109}