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-abbr-element"><abbr></a> 023 * element. 024 * 025 * <p> 026 * The abbr element represents an abbreviation or acronym. It is used to mark up abbreviated text 027 * and provide an optional expansion or explanation via the title attribute. This helps screen 028 * readers and other assistive technologies understand the full meaning of abbreviations, and 029 * provides tooltips for users when they hover over the abbreviated text. 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 abbreviation</jc> 036 * Abbr <jv>simple</jv> = <jsm>abbr</jsm>(<js>"HyperText Markup Language"</js>, <js>"HTML"</js>); 037 * 038 * <jc>// Acronym with expansion</jc> 039 * Abbr <jv>acronym</jv> = <jsm>abbr</jsm>(<js>"World Wide Web"</js>, <js>"WWW"</js>); 040 * 041 * <jc>// Technical abbreviation</jc> 042 * Abbr <jv>technical</jv> = <jsm>abbr</jsm>(<js>"Cascading Style Sheets"</js>, <js>"CSS"</js>); 043 * 044 * <jc>// Date abbreviation</jc> 045 * Abbr <jv>date</jv> = <jsm>abbr</jsm>(<js>"January"</js>, <js>"Jan"</js>); 046 * 047 * <jc>// Abbreviation with styling</jc> 048 * Abbr <jv>styled</jv> = <jsm>abbr</jsm>(<js>"JavaScript Object Notation"</js>, <js>"JSON"</js>) 049 * .class_(<js>"abbreviation"</js>); 050 * 051 * <jc>// Multiple abbreviations in text</jc> 052 * Abbr <jv>multiple</jv> = <jsm>abbr</jsm>() 053 * .children( 054 * <js>"The "</js>, 055 * <jsm>abbr</jsm>(<js>"World Wide Web Consortium"</js>, <js>"W3C"</js>), 056 * <js>" defines "</js>, 057 * <jsm>abbr</jsm>(<js>"HyperText Markup Language"</js>, <js>"HTML"</js>), 058 * <js>" standards."</js> 059 * ); 060 * </p> 061 * 062 * <p> 063 * The following convenience methods are provided for constructing instances of this bean: 064 * <ul class='javatree'> 065 * <li class='jc'>{@link HtmlBuilder} 066 * <ul class='javatree'> 067 * <li class='jm'>{@link HtmlBuilder#abbr() abbr()} 068 * <li class='jm'>{@link HtmlBuilder#abbr(String, Object...) abbr(Object, Object...)} 069 * </ul> 070 * </ul> 071 * </p> 072 * 073 * <h5 class='section'>See Also:</h5><ul> 074 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanHtml5">juneau-bean-html5</a> 075 * </ul> 076 */ 077@Marshalled(typeName = "abbr") 078public class Abbr extends HtmlElementMixed<Abbr> { 079 080 /** 081 * Creates an empty {@link Abbr} element. 082 */ 083 public Abbr() {} 084 085 /** 086 * Creates an {@link Abbr} element with the specified {@link Abbr#title(String)} attribute and 087 * {@link Abbr#children(Object[])} nodes. 088 * 089 * @param title The {@link Abbr#title(String)} attribute. 090 * @param children The {@link Abbr#children(Object[])} nodes. 091 */ 092 public Abbr(String title, Object...children) { 093 title(title).children(children); 094 } 095 096}