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">&lt;ins&gt;</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 * <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 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 * </p>
085 *
086 * <h5 class='section'>See Also:</h5><ul>
087 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanHtml5">juneau-bean-html5</a>
088 * </ul>
089 */
090@Marshalled(typeName = "ins")
091public class Ins extends HtmlElementMixed<Ins> {
092
093   /**
094    * Creates an empty {@link Ins} element.
095    */
096   public Ins() {}
097
098   /**
099    * Creates an {@link Ins} element with the specified child nodes.
100    *
101    * @param children The child nodes. Must not be <jk>null</jk>.
102    */
103   public Ins(Object...children) {
104      children(children);
105   }
106
107   /**
108    * <a class="doclink" href="https://www.w3.org/TR/html5/edits.html#attr-mod-cite">cite</a> attribute.
109    *
110    * <p>
111    * Link to the source of the quotation or more information about the edit.
112    *
113    * @param value The new value for this attribute. Can be <jk>null</jk> to unset the attribute.
114    * @return This object.
115    */
116   public Ins cite(String value) {
117      attr("cite", value);
118      return this;
119   }
120
121   /**
122    * <a class="doclink" href="https://www.w3.org/TR/html5/edits.html#attr-mod-datetime">datetime</a> attribute.
123    *
124    * <p>
125    * Date and (optionally) time of the change.
126    *
127    * @param value The new value for this attribute. Can be <jk>null</jk> to unset the attribute.
128    * @return This object.
129    */
130   public Ins datetime(String value) {
131      attr("datetime", value);
132      return this;
133   }
134
135}