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-ins-element"><ins></a> 023 * element. 024 * 025 * <p> 026 * The ins element represents a range of text that has been added to a document. It is used to 027 * mark up content that has been inserted or added to the document, typically in the context of 028 * document editing or version control. The ins element can contain any flow content and is 029 * commonly used with the del element to show document changes. It is typically rendered with 030 * an underline or other visual indication to show that the content has been added. 031 * 032 * <h2 class='section'>Examples:</h2> 033 * <p class='bcode w800'> 034 * <jk>import static</jk> org.apache.juneau.bean.html5.HtmlBuilder.*; 035 * 036 * <jc>// Simple inserted text</jc> 037 * Ins <jv>simple</jv> = <jsm>ins</jsm>(<js>"This text was added"</js>); 038 * 039 * <jc>// Ins with styling</jc> 040 * Ins <jv>styled</jv> = <jsm>ins</jsm>(<js>"Styled inserted text"</js>) 041 * .class_(<js>"insertion"</js>); 042 * 043 * <jc>// Ins with complex content</jc> 044 * Ins <jv>complex</jv> = <jsm>ins</jsm>( 045 * <js>"The "</js>, 046 * <jsm>strong</jsm>(<js>"new feature"</js>), 047 * <js>" has been added to the system."</js> 048 * ); 049 * 050 * <jc>// Ins with ID</jc> 051 * Ins <jv>withId</jv> = <jsm>ins</jsm>(<js>"Text with ID"</js>) 052 * .id(<js>"inserted-text"</js>); 053 * 054 * <jc>// Ins with styling</jc> 055 * Ins <jv>styled2</jv> = <jsm>ins</jsm>(<js>"Custom styled inserted text"</js>) 056 * .style(<js>"background-color: #d4edda; color: #155724; text-decoration: underline;"</js>); 057 * 058 * <jc>// Ins with multiple elements</jc> 059 * Ins <jv>multiple</jv> = <jsm>ins</jsm>( 060 * <js>"The "</js>, 061 * <jsm>ins</jsm>(<js>"new section"</js>), 062 * <js>" has been "</js>, 063 * <jsm>ins</jsm>(<js>"added"</js>), 064 * <js>" to the document."</js> 065 * ); 066 * 067 * <jc>// Ins with links</jc> 068 * Ins <jv>withLinks</jv> = <jsm>ins</jsm>( 069 * <js>"See "</js>, 070 * <jsm>a</jsm>(<js>"/changes"</js>, <js>"change log"</js>), 071 * <js>" for more details."</js> 072 * ); 073 * </p> 074 * 075 * <p> 076 * The following convenience methods are provided for constructing instances of this bean: 077 * <ul class='javatree'> 078 * <li class='jc'>{@link HtmlBuilder} 079 * <ul class='javatree'> 080 * <li class='jm'>{@link HtmlBuilder#ins() ins()} 081 * <li class='jm'>{@link HtmlBuilder#ins(Object...) ins(Object...)} 082 * </ul> 083 * </ul> 084 * 085 * <h2 class='section'>See Also:</h2><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 = "ins") 090public class Ins extends HtmlElementMixed<Ins> { 091 092 /** 093 * Creates an empty {@link Ins} element. 094 */ 095 public Ins() {} 096 097 /** 098 * Creates an {@link Ins} element with the specified child nodes. 099 * 100 * @param children The child nodes. Must not be <jk>null</jk>. 101 */ 102 public Ins(Object...children) { 103 children(children); 104 } 105 106 /** 107 * <a class="doclink" href="https://www.w3.org/TR/html5/edits.html#attr-mod-cite">cite</a> attribute. 108 * 109 * <p> 110 * Link to the source of the quotation or more information about the edit. 111 * 112 * @param value The new value for this attribute. Can be <jk>null</jk> to unset the attribute. 113 * @return This object. 114 */ 115 public Ins cite(String value) { 116 attr("cite", value); 117 return this; 118 } 119 120 /** 121 * <a class="doclink" href="https://www.w3.org/TR/html5/edits.html#attr-mod-datetime">datetime</a> attribute. 122 * 123 * <p> 124 * Date and (optionally) time of the change. 125 * 126 * @param value The new value for this attribute. Can be <jk>null</jk> to unset the attribute. 127 * @return This object. 128 */ 129 public Ins datetime(String value) { 130 attr("datetime", value); 131 return this; 132 } 133 134}