@@ -57,8 +57,7 @@ public class XmlFactory
57
57
/**********************************************************************
58
58
*/
59
59
60
- // !!! 09-Jan-2018, tatu: make final ASAP
61
- protected String _cfgNameForTextElement ;
60
+ protected final String _cfgNameForTextElement ;
62
61
63
62
protected final XmlNameProcessor _nameProcessor ;
64
63
@@ -93,7 +92,7 @@ public XmlFactory(XMLInputFactory xmlIn) {
93
92
public XmlFactory (XMLInputFactory xmlIn , XMLOutputFactory xmlOut ) {
94
93
this (DEFAULT_XML_READ_FEATURE_FLAGS , DEFAULT_XML_WRITE_FEATURE_FLAGS ,
95
94
xmlIn , xmlOut , XmlNameProcessors .newPassthroughProcessor (),
96
- null );
95
+ FromXmlParser . DEFAULT_UNNAMED_TEXT_PROPERTY );
97
96
}
98
97
99
98
protected XmlFactory (int xpFeatures , int xgFeatures ,
@@ -435,15 +434,11 @@ public FromXmlParser createParser(ObjectReadContext readCtxt,
435
434
}
436
435
437
436
// false -> not managed
438
- FromXmlParser xp = new FromXmlParser (readCtxt ,
437
+ return new FromXmlParser (readCtxt ,
439
438
_createContext (_createContentReference (sr ), false ),
440
439
readCtxt .getStreamReadFeatures (_streamReadFeatures ),
441
440
readCtxt .getFormatReadFeatures (_formatReadFeatures ),
442
- sr , _nameProcessor );
443
- if (_cfgNameForTextElement != null ) {
444
- xp .setXMLTextElementName (_cfgNameForTextElement );
445
- }
446
- return xp ;
441
+ sr , _nameProcessor , _cfgNameForTextElement );
447
442
}
448
443
449
444
/**
@@ -480,14 +475,10 @@ protected FromXmlParser _createParser(ObjectReadContext readCtxt, IOContext ioCt
480
475
return StaxUtil .throwAsReadException (e , null );
481
476
}
482
477
sr = _initializeXmlReader (sr );
483
- FromXmlParser xp = new FromXmlParser (readCtxt , ioCtxt ,
478
+ return new FromXmlParser (readCtxt , ioCtxt ,
484
479
readCtxt .getStreamReadFeatures (_streamReadFeatures ),
485
480
readCtxt .getFormatReadFeatures (_formatReadFeatures ),
486
- sr , _nameProcessor );
487
- if (_cfgNameForTextElement != null ) {
488
- xp .setXMLTextElementName (_cfgNameForTextElement );
489
- }
490
- return xp ;
481
+ sr , _nameProcessor , _cfgNameForTextElement );
491
482
}
492
483
493
484
@ Override
@@ -501,14 +492,10 @@ protected FromXmlParser _createParser(ObjectReadContext readCtxt, IOContext ioCt
501
492
return StaxUtil .throwAsReadException (e , null );
502
493
}
503
494
sr = _initializeXmlReader (sr );
504
- FromXmlParser xp = new FromXmlParser (readCtxt , ioCtxt ,
495
+ return new FromXmlParser (readCtxt , ioCtxt ,
505
496
readCtxt .getStreamReadFeatures (_streamReadFeatures ),
506
497
readCtxt .getFormatReadFeatures (_formatReadFeatures ),
507
- sr , _nameProcessor );
508
- if (_cfgNameForTextElement != null ) {
509
- xp .setXMLTextElementName (_cfgNameForTextElement );
510
- }
511
- return xp ;
498
+ sr , _nameProcessor , _cfgNameForTextElement );
512
499
}
513
500
514
501
@ Override
@@ -531,14 +518,10 @@ protected FromXmlParser _createParser(ObjectReadContext readCtxt, IOContext ioCt
531
518
return StaxUtil .throwAsReadException (e , null );
532
519
}
533
520
sr = _initializeXmlReader (sr );
534
- FromXmlParser xp = new FromXmlParser (readCtxt , ioCtxt ,
521
+ return new FromXmlParser (readCtxt , ioCtxt ,
535
522
readCtxt .getStreamReadFeatures (_streamReadFeatures ),
536
523
readCtxt .getFormatReadFeatures (_formatReadFeatures ),
537
- sr , _nameProcessor );
538
- if (_cfgNameForTextElement != null ) {
539
- xp .setXMLTextElementName (_cfgNameForTextElement );
540
- }
541
- return xp ;
524
+ sr , _nameProcessor , _cfgNameForTextElement );
542
525
}
543
526
544
527
@ Override
@@ -558,14 +541,10 @@ protected FromXmlParser _createParser(ObjectReadContext readCtxt, IOContext ioCt
558
541
return StaxUtil .throwAsReadException (e , null );
559
542
}
560
543
sr = _initializeXmlReader (sr );
561
- FromXmlParser xp = new FromXmlParser (readCtxt , ioCtxt ,
544
+ return new FromXmlParser (readCtxt , ioCtxt ,
562
545
readCtxt .getStreamReadFeatures (_streamReadFeatures ),
563
546
readCtxt .getFormatReadFeatures (_formatReadFeatures ),
564
- sr , _nameProcessor );
565
- if (_cfgNameForTextElement != null ) {
566
- xp .setXMLTextElementName (_cfgNameForTextElement );
567
- }
568
- return xp ;
547
+ sr , _nameProcessor , _cfgNameForTextElement );
569
548
}
570
549
571
550
/*
0 commit comments