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 * <ul class='seealso'> 026 * <li class='link'>{@doc juneau-dto.HTML5} 027 * </ul> 028 */ 029@Bean(typeName="base") 030public class Base extends HtmlElementVoid { 031 032 /** 033 * {@doc HTML5.document-metadata#attr-base-href href} attribute. 034 * 035 * <p> 036 * Document base URL. 037 * 038 * <p> 039 * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}. 040 * Strings must be valid URIs. 041 * 042 * <p> 043 * URIs defined by {@link UriResolver} can be used for values. 044 * 045 * @param href 046 * The new value for this attribute. 047 * Typically a {@link URL} or {@link String}. 048 * @return This object (for method chaining). 049 */ 050 public final Base href(Object href) { 051 attrUri("href", href); 052 return this; 053 } 054 055 /** 056 * {@doc HTML5.document-metadata#attr-base-target target} 057 * attribute. 058 * 059 * <p> 060 * Default browsing context for hyperlink navigation and form submission. 061 * 062 * @param target The new value for this attribute. 063 * @return This object (for method chaining). 064 */ 065 public final Base target(String target) { 066 attr("target", target); 067 return this; 068 } 069 070 071 //----------------------------------------------------------------------------------------------------------------- 072 // Overridden methods 073 //----------------------------------------------------------------------------------------------------------------- 074 075 @Override /* HtmlElement */ 076 public final Base _class(String _class) { 077 super._class(_class); 078 return this; 079 } 080 081 @Override /* HtmlElement */ 082 public final Base id(String id) { 083 super.id(id); 084 return this; 085 } 086 087 @Override /* HtmlElement */ 088 public final Base style(String style) { 089 super.style(style); 090 return this; 091 } 092}