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 * <h5 class='section'>Examples:</h5> 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 * </p> 061 * 062 * <h5 class='section'>See Also:</h5><ul> 063 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanHtml5">juneau-bean-html5</a> 064 * </ul> 065 */ 066@Marshalled(typeName = "del") 067public class Del extends HtmlElementMixed<Del> { 068 069 /** 070 * Creates an empty {@link Del} element. 071 */ 072 public Del() {} 073 074 /** 075 * Creates a {@link Del} element with the specified {@link Del#children(Object[])} node. 076 * 077 * @param children The {@link Del#children(Object[])} node. Must not be <jk>null</jk>. 078 */ 079 public Del(Object...children) { 080 children(children); 081 } 082 083 /** 084 * <a class="doclink" href="https://www.w3.org/TR/html5/edits.html#attr-mod-cite">cite</a> attribute. 085 * 086 * <p> 087 * Specifies the URL of a document that explains the reason for the deletion. 088 * This provides context and justification for the edit. 089 * 090 * <p> 091 * The URL should point to a document that explains why the content was deleted. 092 * 093 * @param value The URL explaining the reason for the deletion. Can be <jk>null</jk> to unset the attribute. 094 * @return This object. 095 */ 096 public Del cite(String value) { 097 attr("cite", value); 098 return this; 099 } 100 101 /** 102 * <a class="doclink" href="https://www.w3.org/TR/html5/edits.html#attr-mod-datetime">datetime</a> attribute. 103 * 104 * <p> 105 * Specifies the date and time when the content was deleted. Used for tracking 106 * the history of document changes. 107 * 108 * <p> 109 * The value should be a valid date-time string in ISO 8601 format. 110 * 111 * @param value The date and time when the content was deleted. Can be <jk>null</jk> to unset the attribute. 112 * @return This object. 113 */ 114 public Del datetime(String value) { 115 attr("datetime", value); 116 return this; 117 } 118 119}