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/edits.html#the-del-element"><del></a> 023 * element. 024 * 025 * <p> 026 * The del element represents text that has been deleted from a document. It is typically rendered 027 * with a strikethrough effect to indicate that the content has been removed. The cite and datetime 028 * attributes can be used to provide information about when and why the deletion occurred. 029 * 030 * <h2 class='section'>Examples:</h2> 031 * <p class='bcode w800'> 032 * <jk>import static</jk> org.apache.juneau.bean.html5.HtmlBuilder.*; 033 * 034 * <jc>// Simple deleted text</jc> 035 * Del <jv>del1</jv> = <jsm>del</jsm>(<js>"This text has been removed."</js>); 036 * 037 * <jc>// Deleted text with citation and timestamp</jc> 038 * Del <jv>del2</jv> = <jsm>del</jsm>() 039 * .cite(<js>"https://example.com/revision-log"</js>) 040 * .datetime(<js>"2024-01-15T10:30:00Z"</js>) 041 * .text(<js>"Outdated information removed"</js>); 042 * 043 * <jc>// Deleted text with reason</jc> 044 * Del <jv>del3</jv> = <jsm>del</jsm>() 045 * .cite(<js>"https://example.com/corrections"</js>) 046 * .datetime(<js>"2024-01-15"</js>) 047 * .text(<js>"Incorrect statement"</js>) 048 * .title(<js>"Removed due to factual error"</js>); 049 * </p> 050 * 051 * <p> 052 * The following convenience methods are provided for constructing instances of this bean: 053 * <ul class='javatree'> 054 * <li class='jc'>{@link HtmlBuilder} 055 * <ul class='javatree'> 056 * <li class='jm'>{@link HtmlBuilder#del() del()} 057 * <li class='jm'>{@link HtmlBuilder#del(Object...) del(Object...)} 058 * </ul> 059 * </ul> 060 * 061 * <h2 class='section'>See Also:</h2><ul> 062 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanHtml5">juneau-bean-html5</a> 063 * </ul> 064 */ 065@Marshalled(typeName = "del") 066public class Del extends HtmlElementMixed<Del> { 067 068 /** 069 * Creates an empty {@link Del} element. 070 */ 071 public Del() {} 072 073 /** 074 * Creates a {@link Del} element with the specified {@link Del#children(Object[])} node. 075 * 076 * @param children The {@link Del#children(Object[])} node. Must not be <jk>null</jk>. 077 */ 078 public Del(Object...children) { 079 children(children); 080 } 081 082 /** 083 * <a class="doclink" href="https://www.w3.org/TR/html5/edits.html#attr-mod-cite">cite</a> attribute. 084 * 085 * <p> 086 * Specifies the URL of a document that explains the reason for the deletion. 087 * This provides context and justification for the edit. 088 * 089 * <p> 090 * The URL should point to a document that explains why the content was deleted. 091 * 092 * @param value The URL explaining the reason for the deletion. Can be <jk>null</jk> to unset the attribute. 093 * @return This object. 094 */ 095 public Del cite(String value) { 096 attr("cite", value); 097 return this; 098 } 099 100 /** 101 * <a class="doclink" href="https://www.w3.org/TR/html5/edits.html#attr-mod-datetime">datetime</a> attribute. 102 * 103 * <p> 104 * Specifies the date and time when the content was deleted. Used for tracking 105 * the history of document changes. 106 * 107 * <p> 108 * The value should be a valid date-time string in ISO 8601 format. 109 * 110 * @param value The date and time when the content was deleted. Can be <jk>null</jk> to unset the attribute. 111 * @return This object. 112 */ 113 public Del datetime(String value) { 114 attr("datetime", value); 115 return this; 116 } 117 118}