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/grouping-content.html#the-blockquote-element">&lt;blockquote&gt;</a>
023 * element.
024 *
025 * <p>
026 * The blockquote element represents a section that is quoted from another source. It is typically
027 * rendered as an indented block of text to distinguish it from the surrounding content. The cite
028 * attribute can be used to provide a link to the source of the quotation.
029 *
030 * <h5 class='section'>Examples:</h5>
031 * <p class='bcode w800'>
032 *    <jc>// Simple blockquote</jc>
033 *    Blockquote <jv>quote1</jv> = <jsm>blockquote</jsm>().text(<js>"The only way to do great work is to love what you do."</js>);
034 *
035 *    <jc>// Blockquote with citation</jc>
036 *    Blockquote <jv>quote2</jv> = <jsm>blockquote</jsm>()
037 *       .cite(<js>"https://example.com/source"</js>)
038 *       .text(<js>"Innovation distinguishes between a leader and a follower."</js>);
039 *
040 *    <jc>// Blockquote with nested content</jc>
041 *    Blockquote <jv>quote3</jv> = <jsm>blockquote</jsm>()
042 *       .cite(<js>"https://example.com/article"</js>)
043 *       .children(
044 *          <jsm>p</jsm>().text(<js>"This is a longer quotation that spans multiple paragraphs."</js>),
045 *          <jsm>p</jsm>().text(<js>"It can contain various HTML elements."</js>)
046 *       );
047 * </p>
048 *
049 * <p>
050 * The following convenience methods are provided for constructing instances of this bean:
051 * <ul class='javatree'>
052 *    <li class='jc'>{@link HtmlBuilder}
053 *    <ul class='javatree'>
054 *       <li class='jm'>{@link HtmlBuilder#blockquote() blockquote()}
055 *       <li class='jm'>{@link HtmlBuilder#blockquote(Object...) blockquote(Object...)}
056 *    </ul>
057 * </ul>
058 * </p>
059 *
060 * <h5 class='section'>See Also:</h5><ul>
061 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanHtml5">juneau-bean-html5</a>
062 * </ul>
063 */
064@Marshalled(typeName = "blockquote")
065public class Blockquote extends HtmlElementMixed<Blockquote> {
066
067   /**
068    * Creates an empty {@link Blockquote} element.
069    */
070   public Blockquote() {}
071
072   /**
073    * Creates a {@link Blockquote} element with the specified child nodes.
074    *
075    * @param children The child nodes. Must not be <jk>null</jk>.
076    */
077   public Blockquote(Object...children) {
078      children(children);
079   }
080
081   /**
082    * <a class="doclink" href="https://www.w3.org/TR/html5/grouping-content.html#attr-blockquote-cite">cite</a>
083    * attribute.
084    *
085    * <p>
086    * Specifies the URL of the source document or message from which the quotation was taken.
087    * This provides context and attribution for the quoted content.
088    *
089    * <p>
090    * The URL should point to the original source of the quoted material.
091    *
092    * @param value The URL of the source document for the quotation. Can be <jk>null</jk> to unset the attribute.
093    * @return This object.
094    */
095   public Blockquote cite(String value) {
096      attr("cite", value);
097      return this;
098   }
099
100}