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