|
16 | 16 | import com.fasterxml.jackson.core.util.ByteArrayBuilder;
|
17 | 17 | import com.fasterxml.jackson.dataformat.xml.PackageVersion;
|
18 | 18 | import com.fasterxml.jackson.dataformat.xml.XmlMapper;
|
| 19 | +import com.fasterxml.jackson.dataformat.xml.util.CaseInsensitiveNameSet; |
19 | 20 | import com.fasterxml.jackson.dataformat.xml.util.StaxUtil;
|
20 | 21 |
|
21 | 22 | /**
|
@@ -317,21 +318,31 @@ public XMLStreamReader getStaxReader() {
|
317 | 318 | * patch versions). So if you have to use it, be prepared for
|
318 | 319 | * possible additional work.
|
319 | 320 | *
|
320 |
| - * @since 2.1 |
| 321 | + * @since 2.12 |
321 | 322 | */
|
322 |
| - public void addVirtualWrapping(Set<String> namesToWrap) |
| 323 | + public void addVirtualWrapping(Set<String> namesToWrap0, boolean caseInsensitive) |
323 | 324 | {
|
324 |
| -//System.out.println("addVirtualWrapping("+namesToWrap+")"); |
325 |
| - // 17-Sep-2012, tatu: Not 100% sure why, but this is necessary to avoid |
| 325 | +System.out.printf("addVirtualWrapping(%s) [case-insensitive? %s]\n", namesToWrap0, caseInsensitive); |
| 326 | + |
| 327 | + final Set<String> namesToWrap = caseInsensitive |
| 328 | + ? CaseInsensitiveNameSet.construct(namesToWrap0) |
| 329 | + : namesToWrap0; |
| 330 | + |
| 331 | +// 17-Sep-2012, tatu: Not 100% sure why, but this is necessary to avoid |
326 | 332 | // problems with Lists-in-Lists properties
|
327 | 333 | String name = _xmlTokens.getLocalName();
|
328 |
| - if (name != null && namesToWrap.contains(name)) { |
329 |
| -//System.out.println("REPEAT from addVirtualWrapping()"); |
| 334 | + if ((name != null) && namesToWrap.contains(name)) { |
| 335 | +System.out.println("REPEAT from addVirtualWrapping()"); |
330 | 336 | _xmlTokens.repeatStartElement();
|
331 | 337 | }
|
332 | 338 | _parsingContext.setNamesToWrap(namesToWrap);
|
333 | 339 | }
|
334 | 340 |
|
| 341 | + @Deprecated // since 2.12 |
| 342 | + public void addVirtualWrapping(Set<String> namesToWrap) { |
| 343 | + addVirtualWrapping(namesToWrap, false); |
| 344 | + } |
| 345 | + |
335 | 346 | /*
|
336 | 347 | /**********************************************************
|
337 | 348 | /* JsonParser impl
|
|
0 commit comments