@@ -44,27 +44,28 @@ public enum JsonReadFeature
44
44
// // // Support for non-standard data format constructs: quoting/escaping
45
45
46
46
/**
47
- * Feature that determines whether parser will allow use
48
- * of single quotes (apostrophe, character '\'') for
49
- * quoting Strings (names and String values). If so,
50
- * this is in addition to other acceptable markers.
47
+ * Feature that can be enabled to accept quoting of all character
48
+ * using backslash quoting mechanism: if not enabled, only characters
49
+ * that are explicitly listed by JSON specification can be thus
50
+ * escaped (see JSON spec for small list of these characters)
51
51
*<p>
52
- * Since JSON specification requires use of double quotes for
53
- * field names,
52
+ * Since JSON specification requires quoting for all control characters,
54
53
* this is a non-standard feature, and as such disabled by default.
55
54
*/
56
- ALLOW_SINGLE_QUOTES (false , JsonParser .Feature .ALLOW_SINGLE_QUOTES ),
55
+ @ SuppressWarnings ("deprecation" )
56
+ ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER (false , JsonParser .Feature .ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER ),
57
57
58
58
/**
59
59
* Feature that determines whether parser will allow use
60
- * of unquoted field names (which is allowed by Javascript,
61
- * but not by JSON specification).
60
+ * of single quotes (apostrophe, character '\'') for
61
+ * quoting Strings (names and String values). If so,
62
+ * this is in addition to other acceptable markers.
62
63
*<p>
63
64
* Since JSON specification requires use of double quotes for
64
65
* field names,
65
66
* this is a non-standard feature, and as such disabled by default.
66
67
*/
67
- ALLOW_UNQUOTED_FIELD_NAMES (false , JsonParser .Feature .ALLOW_UNQUOTED_FIELD_NAMES ),
68
+ ALLOW_SINGLE_QUOTES (false , JsonParser .Feature .ALLOW_SINGLE_QUOTES ),
68
69
69
70
/**
70
71
* Feature that determines whether parser will allow
@@ -80,6 +81,17 @@ public enum JsonReadFeature
80
81
@ SuppressWarnings ("deprecation" )
81
82
ALLOW_UNESCAPED_CONTROL_CHARS (false , JsonParser .Feature .ALLOW_UNQUOTED_CONTROL_CHARS ),
82
83
84
+ /**
85
+ * Feature that determines whether parser will allow use
86
+ * of unquoted field names (which is allowed by Javascript,
87
+ * but not by JSON specification).
88
+ *<p>
89
+ * Since JSON specification requires use of double quotes for
90
+ * field names,
91
+ * this is a non-standard feature, and as such disabled by default.
92
+ */
93
+ ALLOW_UNQUOTED_FIELD_NAMES (false , JsonParser .Feature .ALLOW_UNQUOTED_FIELD_NAMES ),
94
+
83
95
/**
84
96
* Feature that determines whether parser will allow
85
97
* Record Separator (RS) control character ({@code 0x1E})
@@ -93,32 +105,21 @@ public enum JsonReadFeature
93
105
@ SuppressWarnings ("deprecation" )
94
106
ALLOW_RS_CONTROL_CHAR (false , JsonParser .Feature .ALLOW_RS_CONTROL_CHAR ),
95
107
96
- /**
97
- * Feature that can be enabled to accept quoting of all character
98
- * using backslash quoting mechanism: if not enabled, only characters
99
- * that are explicitly listed by JSON specification can be thus
100
- * escaped (see JSON spec for small list of these characters)
101
- *<p>
102
- * Since JSON specification requires quoting for all control characters,
103
- * this is a non-standard feature, and as such disabled by default.
104
- */
105
- @ SuppressWarnings ("deprecation" )
106
- ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER (false , JsonParser .Feature .ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER ),
107
-
108
108
// // // Support for non-standard data format constructs: number representations
109
109
110
110
/**
111
111
* Feature that determines whether parser will allow
112
- * JSON integral numbers to start with additional (ignorable)
113
- * zeroes (like: 000001). If enabled, no exception is thrown, and extra
114
- * nulls are silently ignored (and not included in textual representation
115
- * exposed via {@link JsonParser#getText}).
112
+ * JSON decimal numbers to start with a decimal point
113
+ * (like: .123). If enabled, no exception is thrown, and the number
114
+ * is parsed as though a leading 0 had been present.
116
115
*<p>
117
- * Since JSON specification does not allow leading zeroes ,
116
+ * Since JSON specification does not allow leading decimal points ,
118
117
* this is a non-standard feature, and as such disabled by default.
118
+ *
119
+ * @since 2.11
119
120
*/
120
121
@ SuppressWarnings ("deprecation" )
121
- ALLOW_LEADING_ZEROS_FOR_NUMBERS (false , JsonParser .Feature .ALLOW_NUMERIC_LEADING_ZEROS ),
122
+ ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS (false , JsonParser .Feature .ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS ),
122
123
123
124
/**
124
125
* Feature that determines whether parser will allow
@@ -134,34 +135,18 @@ public enum JsonReadFeature
134
135
@ SuppressWarnings ("deprecation" )
135
136
ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS (false , JsonParser .Feature .ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS ),
136
137
137
-
138
138
/**
139
139
* Feature that determines whether parser will allow
140
- * JSON decimal numbers to start with a decimal point
141
- * (like: .123). If enabled, no exception is thrown, and the number
142
- * is parsed as though a leading 0 had been present.
143
- *<p>
144
- * Since JSON specification does not allow leading decimal points,
145
- * this is a non-standard feature, and as such disabled by default.
146
- *
147
- * @since 2.11
148
- */
149
- @ SuppressWarnings ("deprecation" )
150
- ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS (false , JsonParser .Feature .ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS ),
151
-
152
- /**
153
- * Feature that determines whether parser will allow
154
- * JSON decimal numbers to end with a decimal point
155
- * (like: 123.). If enabled, no exception is thrown, and the number
156
- * is parsed as though the trailing decimal point had not been present.
140
+ * JSON integral numbers to start with additional (ignorable)
141
+ * zeroes (like: 000001). If enabled, no exception is thrown, and extra
142
+ * nulls are silently ignored (and not included in textual representation
143
+ * exposed via {@link JsonParser#getText}).
157
144
*<p>
158
- * Since JSON specification does not allow trailing decimal points ,
145
+ * Since JSON specification does not allow leading zeroes ,
159
146
* this is a non-standard feature, and as such disabled by default.
160
- *
161
- * @since 2.14
162
147
*/
163
148
@ SuppressWarnings ("deprecation" )
164
- ALLOW_TRAILING_DECIMAL_POINT_FOR_NUMBERS (false , JsonParser .Feature .ALLOW_TRAILING_DECIMAL_POINT_FOR_NUMBERS ),
149
+ ALLOW_LEADING_ZEROS_FOR_NUMBERS (false , JsonParser .Feature .ALLOW_NUMERIC_LEADING_ZEROS ),
165
150
166
151
/**
167
152
* Feature that allows parser to recognize set of
@@ -184,6 +169,20 @@ public enum JsonReadFeature
184
169
@ SuppressWarnings ("deprecation" )
185
170
ALLOW_NON_NUMERIC_NUMBERS (false , JsonParser .Feature .ALLOW_NON_NUMERIC_NUMBERS ),
186
171
172
+ /**
173
+ * Feature that determines whether parser will allow
174
+ * JSON decimal numbers to end with a decimal point
175
+ * (like: 123.). If enabled, no exception is thrown, and the number
176
+ * is parsed as though the trailing decimal point had not been present.
177
+ *<p>
178
+ * Since JSON specification does not allow trailing decimal points,
179
+ * this is a non-standard feature, and as such disabled by default.
180
+ *
181
+ * @since 2.14
182
+ */
183
+ @ SuppressWarnings ("deprecation" )
184
+ ALLOW_TRAILING_DECIMAL_POINT_FOR_NUMBERS (false , JsonParser .Feature .ALLOW_TRAILING_DECIMAL_POINT_FOR_NUMBERS ),
185
+
187
186
// // // Support for non-standard data format constructs: array/value separators
188
187
189
188
/**
@@ -226,14 +225,14 @@ public enum JsonReadFeature
226
225
ALLOW_TRAILING_COMMA (false , JsonParser .Feature .ALLOW_TRAILING_COMMA ),
227
226
;
228
227
229
- final private boolean _defaultState ;
230
- final private int _mask ;
228
+ private final boolean _defaultState ;
229
+ private final int _mask ;
231
230
232
231
/**
233
232
* For backwards compatibility we may need to map to one of existing {@link JsonParser.Feature}s;
234
233
* if so, this is the feature to enable/disable.
235
234
*/
236
- final private JsonParser .Feature _mappedFeature ;
235
+ private final JsonParser .Feature _mappedFeature ;
237
236
238
237
/**
239
238
* Method that calculates bit set (flags) of all features that
0 commit comments