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.*;
016
017import org.apache.juneau.*;
018import org.apache.juneau.annotation.*;
019import org.apache.juneau.internal.*;
020
021/**
022 * DTO for an HTML <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#the-form-element">&lt;form&gt;</a>
023 * element.
024 *
025 * <h5 class='section'>See Also:</h5><ul>
026 *    <li class='link'><a class="doclink" href="../../../../../index.html#jd.Html5">Overview &gt; juneau-dto &gt; HTML5</a>
027 * </ul>
028 */
029@Bean(typeName="form")
030@FluentSetters
031public class Form extends HtmlElementMixed {
032
033   /**
034    * Creates an empty {@link Form} element.
035    */
036   public Form() {}
037
038   /**
039    * Creates a {@link Form} element with the specified {@link Form#action(String)} attribute.
040    *
041    * @param action The {@link Form#action(String)} attribute.
042    */
043   public Form(String action) {
044      action(action);
045   }
046
047   /**
048    * Creates an {@link Form} element with the specified {@link Form#action(String)} attribute and child nodes.
049    *
050    * @param action The {@link Form#action(String)} attribute.
051    * @param children The child nodes.
052    */
053   public Form(String action, Object...children) {
054      action(action).children(children);
055   }
056
057   /**
058    * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-form-accept-charset">accept-charset</a>
059    * attribute.
060    *
061    * <p>
062    * Character encodings to use for form submission.
063    *
064    * @param acceptcharset The new value for this attribute.
065    * @return This object.
066    */
067   public final Form acceptcharset(String acceptcharset) {
068      attr("accept-charset", acceptcharset);
069      return this;
070   }
071
072   /**
073    * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-action">action</a> attribute.
074    *
075    * <p>
076    * URL to use for form submission.
077    *
078    * <p>
079    * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}.
080    * Strings must be valid URIs.
081    *
082    * <p>
083    * URIs defined by {@link UriResolver} can be used for values.
084    *
085    * @param action The new value for this attribute.
086    * @return This object.
087    */
088   public final Form action(String action) {
089      attrUri("action", action);
090      return this;
091   }
092
093   /**
094    * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-form-autocomplete">autocomplete</a>
095    * attribute.
096    *
097    * <p>
098    * Default setting for auto-fill feature for controls in the form.
099    *
100    * @param autocomplete The new value for this attribute.
101    * @return This object.
102    */
103   public final Form autocomplete(String autocomplete) {
104      attr("autocomplete", autocomplete);
105      return this;
106   }
107
108   /**
109    * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-enctype">enctype</a> attribute.
110    *
111    * <p>
112    * Form data set encoding type to use for form submission.
113    *
114    * @param enctype The new value for this attribute.
115    * @return This object.
116    */
117   public final Form enctype(String enctype) {
118      attr("enctype", enctype);
119      return this;
120   }
121
122   /**
123    * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-method">method</a> attribute.
124    *
125    * <p>
126    * HTTP method to use for form submission.
127    *
128    * @param method The new value for this attribute.
129    * @return This object.
130    */
131   public final Form method(String method) {
132      attr("method", method);
133      return this;
134   }
135
136   /**
137    * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-form-name">name</a> attribute.
138    *
139    * <p>
140    * Name of form to use in the document.forms API.
141    *
142    * @param name The new value for this attribute.
143    * @return This object.
144    */
145   public final Form name(String name) {
146      attr("name", name);
147      return this;
148   }
149
150   /**
151    * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-novalidate">novalidate</a> attribute.
152    *
153    * <p>
154    * Bypass form control validation for form submission.
155    *
156    * @param novalidate The new value for this attribute.
157    * Typically a {@link Boolean} or {@link String}.
158    * @return This object.
159    */
160   public final Form novalidate(Boolean novalidate) {
161      attr("novalidate", novalidate);
162      return this;
163   }
164
165   /**
166    * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-target">target</a> attribute.
167    *
168    * <p>
169    * Browsing context for form submission.
170    *
171    * @param target The new value for this attribute.
172    * @return This object.
173    */
174   public final Form target(String target) {
175      attr("target", target);
176      return this;
177   }
178
179
180   //-----------------------------------------------------------------------------------------------------------------
181   // Overridden methods
182   //-----------------------------------------------------------------------------------------------------------------
183
184   // <FluentSetters>
185
186   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
187   public Form _class(String _class) {
188      super._class(_class);
189      return this;
190   }
191
192   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
193   public Form accesskey(String accesskey) {
194      super.accesskey(accesskey);
195      return this;
196   }
197
198   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
199   public Form contenteditable(Object contenteditable) {
200      super.contenteditable(contenteditable);
201      return this;
202   }
203
204   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
205   public Form dir(String dir) {
206      super.dir(dir);
207      return this;
208   }
209
210   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
211   public Form hidden(Object hidden) {
212      super.hidden(hidden);
213      return this;
214   }
215
216   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
217   public Form id(String id) {
218      super.id(id);
219      return this;
220   }
221
222   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
223   public Form lang(String lang) {
224      super.lang(lang);
225      return this;
226   }
227
228   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
229   public Form onabort(String onabort) {
230      super.onabort(onabort);
231      return this;
232   }
233
234   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
235   public Form onblur(String onblur) {
236      super.onblur(onblur);
237      return this;
238   }
239
240   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
241   public Form oncancel(String oncancel) {
242      super.oncancel(oncancel);
243      return this;
244   }
245
246   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
247   public Form oncanplay(String oncanplay) {
248      super.oncanplay(oncanplay);
249      return this;
250   }
251
252   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
253   public Form oncanplaythrough(String oncanplaythrough) {
254      super.oncanplaythrough(oncanplaythrough);
255      return this;
256   }
257
258   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
259   public Form onchange(String onchange) {
260      super.onchange(onchange);
261      return this;
262   }
263
264   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
265   public Form onclick(String onclick) {
266      super.onclick(onclick);
267      return this;
268   }
269
270   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
271   public Form oncuechange(String oncuechange) {
272      super.oncuechange(oncuechange);
273      return this;
274   }
275
276   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
277   public Form ondblclick(String ondblclick) {
278      super.ondblclick(ondblclick);
279      return this;
280   }
281
282   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
283   public Form ondurationchange(String ondurationchange) {
284      super.ondurationchange(ondurationchange);
285      return this;
286   }
287
288   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
289   public Form onemptied(String onemptied) {
290      super.onemptied(onemptied);
291      return this;
292   }
293
294   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
295   public Form onended(String onended) {
296      super.onended(onended);
297      return this;
298   }
299
300   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
301   public Form onerror(String onerror) {
302      super.onerror(onerror);
303      return this;
304   }
305
306   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
307   public Form onfocus(String onfocus) {
308      super.onfocus(onfocus);
309      return this;
310   }
311
312   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
313   public Form oninput(String oninput) {
314      super.oninput(oninput);
315      return this;
316   }
317
318   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
319   public Form oninvalid(String oninvalid) {
320      super.oninvalid(oninvalid);
321      return this;
322   }
323
324   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
325   public Form onkeydown(String onkeydown) {
326      super.onkeydown(onkeydown);
327      return this;
328   }
329
330   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
331   public Form onkeypress(String onkeypress) {
332      super.onkeypress(onkeypress);
333      return this;
334   }
335
336   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
337   public Form onkeyup(String onkeyup) {
338      super.onkeyup(onkeyup);
339      return this;
340   }
341
342   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
343   public Form onload(String onload) {
344      super.onload(onload);
345      return this;
346   }
347
348   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
349   public Form onloadeddata(String onloadeddata) {
350      super.onloadeddata(onloadeddata);
351      return this;
352   }
353
354   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
355   public Form onloadedmetadata(String onloadedmetadata) {
356      super.onloadedmetadata(onloadedmetadata);
357      return this;
358   }
359
360   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
361   public Form onloadstart(String onloadstart) {
362      super.onloadstart(onloadstart);
363      return this;
364   }
365
366   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
367   public Form onmousedown(String onmousedown) {
368      super.onmousedown(onmousedown);
369      return this;
370   }
371
372   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
373   public Form onmouseenter(String onmouseenter) {
374      super.onmouseenter(onmouseenter);
375      return this;
376   }
377
378   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
379   public Form onmouseleave(String onmouseleave) {
380      super.onmouseleave(onmouseleave);
381      return this;
382   }
383
384   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
385   public Form onmousemove(String onmousemove) {
386      super.onmousemove(onmousemove);
387      return this;
388   }
389
390   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
391   public Form onmouseout(String onmouseout) {
392      super.onmouseout(onmouseout);
393      return this;
394   }
395
396   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
397   public Form onmouseover(String onmouseover) {
398      super.onmouseover(onmouseover);
399      return this;
400   }
401
402   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
403   public Form onmouseup(String onmouseup) {
404      super.onmouseup(onmouseup);
405      return this;
406   }
407
408   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
409   public Form onmousewheel(String onmousewheel) {
410      super.onmousewheel(onmousewheel);
411      return this;
412   }
413
414   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
415   public Form onpause(String onpause) {
416      super.onpause(onpause);
417      return this;
418   }
419
420   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
421   public Form onplay(String onplay) {
422      super.onplay(onplay);
423      return this;
424   }
425
426   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
427   public Form onplaying(String onplaying) {
428      super.onplaying(onplaying);
429      return this;
430   }
431
432   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
433   public Form onprogress(String onprogress) {
434      super.onprogress(onprogress);
435      return this;
436   }
437
438   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
439   public Form onratechange(String onratechange) {
440      super.onratechange(onratechange);
441      return this;
442   }
443
444   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
445   public Form onreset(String onreset) {
446      super.onreset(onreset);
447      return this;
448   }
449
450   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
451   public Form onresize(String onresize) {
452      super.onresize(onresize);
453      return this;
454   }
455
456   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
457   public Form onscroll(String onscroll) {
458      super.onscroll(onscroll);
459      return this;
460   }
461
462   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
463   public Form onseeked(String onseeked) {
464      super.onseeked(onseeked);
465      return this;
466   }
467
468   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
469   public Form onseeking(String onseeking) {
470      super.onseeking(onseeking);
471      return this;
472   }
473
474   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
475   public Form onselect(String onselect) {
476      super.onselect(onselect);
477      return this;
478   }
479
480   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
481   public Form onshow(String onshow) {
482      super.onshow(onshow);
483      return this;
484   }
485
486   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
487   public Form onstalled(String onstalled) {
488      super.onstalled(onstalled);
489      return this;
490   }
491
492   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
493   public Form onsubmit(String onsubmit) {
494      super.onsubmit(onsubmit);
495      return this;
496   }
497
498   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
499   public Form onsuspend(String onsuspend) {
500      super.onsuspend(onsuspend);
501      return this;
502   }
503
504   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
505   public Form ontimeupdate(String ontimeupdate) {
506      super.ontimeupdate(ontimeupdate);
507      return this;
508   }
509
510   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
511   public Form ontoggle(String ontoggle) {
512      super.ontoggle(ontoggle);
513      return this;
514   }
515
516   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
517   public Form onvolumechange(String onvolumechange) {
518      super.onvolumechange(onvolumechange);
519      return this;
520   }
521
522   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
523   public Form onwaiting(String onwaiting) {
524      super.onwaiting(onwaiting);
525      return this;
526   }
527
528   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
529   public Form spellcheck(Object spellcheck) {
530      super.spellcheck(spellcheck);
531      return this;
532   }
533
534   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
535   public Form style(String style) {
536      super.style(style);
537      return this;
538   }
539
540   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
541   public Form tabindex(Object tabindex) {
542      super.tabindex(tabindex);
543      return this;
544   }
545
546   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
547   public Form title(String title) {
548      super.title(title);
549      return this;
550   }
551
552   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElement */
553   public Form translate(Object translate) {
554      super.translate(translate);
555      return this;
556   }
557
558   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElementMixed */
559   public Form child(Object child) {
560      super.child(child);
561      return this;
562   }
563
564   @Override /* GENERATED - org.apache.juneau.dto.html5.HtmlElementMixed */
565   public Form children(Object...children) {
566      super.children(children);
567      return this;
568   }
569
570   // </FluentSetters>
571}