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 org.apache.juneau.annotation.*;
016
017/**
018 * DTO for an HTML {@doc ExtHTML5.forms#the-keygen-element <keygen>}
019 * element.
020 *
021 * <ul class='seealso'>
022 *    <li class='link'>{@doc DtoHtml5}
023 * </ul>
024 */
025@Bean(typeName="keygen")
026public class Keygen extends HtmlElementVoid {
027
028   /**
029    * Creates an empty {@link Keygen} element.
030    */
031   public Keygen() {}
032
033   /**
034    * {@doc ExtHTML5.forms#attr-fe-autofocus autofocus} attribute.
035    *
036    * <p>
037    * Automatically focus the form control when the page is loaded.
038    *
039    * @param autofocus
040    *    The new value for this attribute.
041    *    Typically a {@link Boolean} or {@link String}.
042    * @return This object (for method chaining).
043    */
044   public final Keygen autofocus(Object autofocus) {
045      attr("autofocus", autofocus);
046      return this;
047   }
048
049   /**
050    * {@doc ExtHTML5.forms#attr-keygen-challenge challenge} attribute.
051    *
052    * <p>
053    * String to package with the generated and signed public key.
054    *
055    * @param challenge The new value for this attribute.
056    * @return This object (for method chaining).
057    */
058   public final Keygen challenge(String challenge) {
059      attr("challenge", challenge);
060      return this;
061   }
062
063   /**
064    * {@doc ExtHTML5.forms#attr-fe-disabled disabled} attribute.
065    *
066    * <p>
067    * Whether the form control is disabled.
068    *
069    * @param disabled
070    *    The new value for this attribute.
071    *    Typically a {@link Boolean} or {@link String}.
072    * @return This object (for method chaining).
073    */
074   public final Keygen disabled(Object disabled) {
075      attr("disabled", deminimize(disabled, "disabled"));
076      return this;
077   }
078
079   /**
080    * {@doc ExtHTML5.forms#attr-fae-form form} attribute.
081    *
082    * <p>
083    * Associates the control with a form element.
084    *
085    * @param form The new value for this attribute.
086    * @return This object (for method chaining).
087    */
088   public final Keygen form(String form) {
089      attr("form", form);
090      return this;
091   }
092
093   /**
094    * {@doc ExtHTML5.forms#attr-keygen-keytype keytype} attribute.
095    *
096    * <p>
097    * The type of cryptographic key to generate.
098    *
099    * @param keytype The new value for this attribute.
100    * @return This object (for method chaining).
101    */
102   public final Keygen keytype(String keytype) {
103      attr("keytype", keytype);
104      return this;
105   }
106
107   /**
108    * {@doc ExtHTML5.forms#attr-fe-name name} attribute.
109    *
110    * <p>
111    * Name of form control to use for form submission and in the form.elements API.
112    *
113    * @param name The new value for this attribute.
114    * @return This object (for method chaining).
115    */
116   public final Keygen name(String name) {
117      attr("name", name);
118      return this;
119   }
120
121
122   //-----------------------------------------------------------------------------------------------------------------
123   // Overridden methods
124   //-----------------------------------------------------------------------------------------------------------------
125
126   @Override /* HtmlElement */
127   public final Keygen _class(String _class) {
128      super._class(_class);
129      return this;
130   }
131
132   @Override /* HtmlElement */
133   public final Keygen id(String id) {
134      super.id(id);
135      return this;
136   }
137
138   @Override /* HtmlElement */
139   public final Keygen style(String style) {
140      super.style(style);
141      return this;
142   }
143}