001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.dto.html5;
014
015import java.net.*;
016import java.net.URI;
017
018import org.apache.juneau.*;
019import org.apache.juneau.annotation.*;
020
021/**
022 * DTO for an HTML {@doc HTML5.document-metadata#the-base-element <base>}
023 * element.
024 *
025 * <h5 class='section'>See Also:</h5>
026 * <ul class='doctree'>
027 *    <li class='link'>{@doc juneau-dto.HTML5}
028 * </ul>
029 */
030@Bean(typeName="base")
031public class Base extends HtmlElementVoid {
032
033   /**
034    * {@doc HTML5.document-metadata#attr-base-href href} attribute.
035    *
036    * <p>
037    * Document base URL.
038    *
039    * <p>
040    * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}.
041    * Strings must be valid URIs.
042    *
043    * <p>
044    * URIs defined by {@link UriResolver} can be used for values.
045    *
046    * @param href
047    *    The new value for this attribute.
048    *    Typically a {@link URL} or {@link String}.
049    * @return This object (for method chaining).
050    */
051   public final Base href(Object href) {
052      attrUri("href", href);
053      return this;
054   }
055
056   /**
057    * {@doc HTML5.document-metadata#attr-base-target target}
058    * attribute.
059    *
060    * <p>
061    * Default browsing context for hyperlink navigation and form submission.
062    *
063    * @param target The new value for this attribute.
064    * @return This object (for method chaining).
065    */
066   public final Base target(String target) {
067      attr("target", target);
068      return this;
069   }
070
071
072   //-----------------------------------------------------------------------------------------------------------------
073   // Overridden methods
074   //-----------------------------------------------------------------------------------------------------------------
075
076   @Override /* HtmlElement */
077   public final Base _class(String _class) {
078      super._class(_class);
079      return this;
080   }
081
082   @Override /* HtmlElement */
083   public final Base id(String id) {
084      super.id(id);
085      return this;
086   }
087
088   @Override /* HtmlElement */
089   public final Base style(String style) {
090      super.style(style);
091      return this;
092   }
093}