1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.javascript.host.html;
16
17 import org.htmlunit.html.DomNode;
18 import org.htmlunit.html.ValidatableElement;
19 import org.htmlunit.javascript.HtmlUnitScriptable;
20 import org.htmlunit.javascript.configuration.JsxClass;
21 import org.htmlunit.javascript.configuration.JsxConstructor;
22 import org.htmlunit.javascript.configuration.JsxGetter;
23
24
25
26
27
28
29
30 @JsxClass
31 public class ValidityState extends HtmlUnitScriptable {
32
33
34
35
36 @JsxConstructor
37 public void jsConstructor() {
38
39 }
40
41 private ValidatableElement getValidatableElementOrDie() {
42 return (ValidatableElement) getDomNodeOrDie();
43 }
44
45
46
47
48 @Override
49 public void setDomNode(final DomNode domNode) {
50 setDomNode(domNode, false);
51 }
52
53
54
55
56
57 @JsxGetter
58 public boolean isBadInput() {
59 return getValidatableElementOrDie().hasBadInputValidityState();
60 }
61
62
63
64
65 @JsxGetter
66 public boolean isCustomError() {
67 return getValidatableElementOrDie().isCustomErrorValidityState();
68 }
69
70
71
72
73
74 @JsxGetter
75 public boolean isPatternMismatch() {
76 return getValidatableElementOrDie().hasPatternMismatchValidityState();
77 }
78
79
80
81
82
83 @JsxGetter
84 public boolean isRangeOverflow() {
85 return getValidatableElementOrDie().hasRangeOverflowValidityState();
86 }
87
88
89
90
91
92 @JsxGetter
93 public boolean isRangeUnderflow() {
94 return getValidatableElementOrDie().hasRangeUnderflowValidityState();
95 }
96
97
98
99
100
101 @JsxGetter
102 public boolean isStepMismatch() {
103 return getValidatableElementOrDie().isStepMismatchValidityState();
104 }
105
106
107
108
109
110 @JsxGetter
111 public boolean isTooLong() {
112 return getValidatableElementOrDie().isTooLongValidityState();
113 }
114
115
116
117
118
119 @JsxGetter
120 public boolean isTooShort() {
121 return getValidatableElementOrDie().isTooShortValidityState();
122 }
123
124
125
126
127
128 @JsxGetter
129 public boolean isTypeMismatch() {
130 return getValidatableElementOrDie().hasTypeMismatchValidityState();
131 }
132
133
134
135
136
137 @JsxGetter
138 public boolean isValueMissing() {
139 return getValidatableElementOrDie().isValueMissingValidityState();
140 }
141
142
143
144
145
146 @JsxGetter
147 public boolean isValid() {
148 return getValidatableElementOrDie().isValidValidityState();
149 }
150 }