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/semantics.html#the-html-element">&lt;html&gt;</a>
023 * element.
024 *
025 * <p>
026 * The html element represents the root of an HTML document. It contains all other HTML elements
027 * and serves as the top-level container for the entire document. The lang attribute is commonly
028 * used to specify the primary language of the document for accessibility and SEO purposes.
029 *
030 * <h5 class='section'>Examples:</h5>
031 * <p class='bcode w800'>
032 *    <jc>// Basic HTML document structure</jc>
033 *    Html <jv>html1</jv> = <jsm>html</jsm>(
034 *       <jsm>head</jsm>(
035 *          <jsm>title</jsm>(<js>"My Web Page"</js>),
036 *          <jsm>meta</jsm>().charset(<js>"utf-8"</js>)
037 *       ),
038 *       <jsm>body</jsm>(<js>"Hello, World!"</js>)
039 *    ).lang(<js>"en"</js>);
040 *
041 *    <jc>// HTML with manifest for offline support</jc>
042 *    Html <jv>html2</jv> = <jsm>html</jsm>(
043 *       <jsm>head</jsm>(
044 *          <jsm>title</jsm>(<js>"Offline App"</js>)
045 *       ),
046 *       <jsm>body</jsm>(<js>"This app works offline!"</js>)
047 *    ).lang(<js>"en"</js>).manifest(<js>"app.manifest"</js>);
048 *
049 *    <jc>// HTML with custom attributes</jc>
050 *    Html <jv>html3</jv> = <jsm>html</jsm>(
051 *       <jsm>head</jsm>(
052 *          <jsm>title</jsm>(<js>"Página en Español"</js>)
053 *       ),
054 *       <jsm>body</jsm>(<js>"¡Hola, Mundo!"</js>)
055 *    ).lang(<js>"es"</js>).class_(<js>"no-js"</js>);
056 * </p>
057 *
058 * <p>
059 * The following convenience methods are provided for constructing instances of this bean:
060 * <ul class='javatree'>
061 *    <li class='jc'>{@link HtmlBuilder}
062 *    <ul class='javatree'>
063 *       <li class='jm'>{@link HtmlBuilder#html() html()}
064 *       <li class='jm'>{@link HtmlBuilder#html(Object...) html(Object...)}
065 *    </ul>
066 * </ul>
067 * </p>
068 *
069 * <h5 class='section'>See Also:</h5><ul>
070 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanHtml5">juneau-bean-html5</a>
071 * </ul>
072 */
073@Marshalled(typeName = "html")
074public class Html extends HtmlElementContainer<Html> {
075
076   /**
077    * Creates an empty {@link Html} element.
078    */
079   public Html() {}
080
081   /**
082    * Creates an {@link Html} element with the specified child nodes.
083    *
084    * @param children The child nodes. Must not be <jk>null</jk>.
085    */
086   public Html(Object...children) {
087      children(children);
088   }
089
090   /**
091    * <a class="doclink" href="https://www.w3.org/TR/html5/semantics.html#attr-html-manifest">manifest</a> attribute.
092    *
093    * <p>
094    * Specifies the URL of the application cache manifest file. This enables offline functionality
095    * by allowing the browser to cache resources for offline use.
096    *
097    * <p>
098    * The manifest file should be a text file that lists resources to be cached.
099    *
100    * @param value The URL of the application cache manifest file. Can be <jk>null</jk> to unset the attribute.
101    * @return This object.
102    */
103   public Html manifest(String value) {
104      attr("manifest", value);
105      return this;
106   }
107
108}