@@ -62,8 +62,6 @@ public static final class Builder {
62
62
*
63
63
* @return this builder
64
64
* @throws IllegalArgumentException if the maxNestingDepth is set to a negative value
65
- *
66
- * @since 2.15
67
65
*/
68
66
public Builder maxNestingDepth (final int maxNestingDepth ) {
69
67
if (maxNestingDepth < 0 ) {
@@ -81,8 +79,6 @@ public Builder maxNestingDepth(final int maxNestingDepth) {
81
79
*
82
80
* @return this builder
83
81
* @throws IllegalArgumentException if the maxNumLen is set to a negative value
84
- *
85
- * @since 2.15
86
82
*/
87
83
public Builder maxNumberLength (final int maxNumLen ) {
88
84
if (maxNumLen < 0 ) {
@@ -106,8 +102,6 @@ public Builder maxNumberLength(final int maxNumLen) {
106
102
*
107
103
* @return this builder
108
104
* @throws IllegalArgumentException if the maxStringLen is set to a negative value
109
- *
110
- * @since 2.15
111
105
*/
112
106
public Builder maxStringLength (final int maxStringLen ) {
113
107
if (maxStringLen < 0 ) {
@@ -144,7 +138,7 @@ public StreamReadConstraints build() {
144
138
/**********************************************************************
145
139
*/
146
140
147
- StreamReadConstraints (final int maxNestingDepth , final int maxNumLen , final int maxStringLen ) {
141
+ protected StreamReadConstraints (final int maxNestingDepth , final int maxNumLen , final int maxStringLen ) {
148
142
_maxNestingDepth = maxNestingDepth ;
149
143
_maxNumLen = maxNumLen ;
150
144
_maxStringLen = maxStringLen ;
@@ -204,7 +198,32 @@ public int getMaxStringLength() {
204
198
205
199
/*
206
200
/**********************************************************************
207
- /* Convenience methods for validation
201
+ /* Convenience methods for validation, document limits
202
+ /**********************************************************************
203
+ */
204
+
205
+ /**
206
+ * Convenience method that can be used to verify that the
207
+ * nesting depth does not exceed the maximum specified by this
208
+ * constraints object: if it does, a
209
+ * {@link StreamConstraintsException}
210
+ * is thrown.
211
+ *
212
+ * @param depth count of unclosed objects and arrays
213
+ *
214
+ * @throws StreamConstraintsException If depth exceeds maximum
215
+ */
216
+ public void validateNestingDepth (int depth ) throws StreamConstraintsException
217
+ {
218
+ if (depth > _maxNestingDepth ) {
219
+ throw new StreamConstraintsException (String .format ("Depth (%d) exceeds the maximum allowed nesting depth (%d)" ,
220
+ depth , _maxNestingDepth ));
221
+ }
222
+ }
223
+
224
+ /*
225
+ /**********************************************************************
226
+ /* Convenience methods for validation, token lengths
208
227
/**********************************************************************
209
228
*/
210
229
@@ -264,23 +283,4 @@ public void validateStringLength(int length) throws StreamConstraintsException
264
283
length , _maxStringLen ));
265
284
}
266
285
}
267
-
268
- /**
269
- * Convenience method that can be used to verify that the
270
- * nesting depth does not exceed the maximum specified by this
271
- * constraints object: if it does, a
272
- * {@link StreamConstraintsException}
273
- * is thrown.
274
- *
275
- * @param depth count of unclosed objects and arrays
276
- *
277
- * @throws StreamConstraintsException If depth exceeds maximum
278
- */
279
- public void validateNestingDepth (int depth ) throws StreamConstraintsException
280
- {
281
- if (depth > _maxNestingDepth ) {
282
- throw new StreamConstraintsException (String .format ("Depth (%d) exceeds the maximum allowed nesting depth (%d)" ,
283
- depth , _maxNestingDepth ));
284
- }
285
- }
286
286
}
0 commit comments