Skip to content

Commit 6586006

Browse files
committed
Fixed #228
1 parent 7ebf8cd commit 6586006

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

release-notes/VERSION

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ Project: jackson-dataformat-xml
66

77
2.9.0 (not yet released)
88

9+
2.8.9 (not yet released)
10+
11+
#228: `XmlReadContext` should hold current value
12+
(suggested by kfypmqqw@github)
13+
914
2.8.8 (05-Apr-2017)
1015
2.8.7 (21-Feb-2017)
1116

src/main/java/com/fasterxml/jackson/dataformat/xml/deser/XmlReadContext.java

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,18 @@ public final class XmlReadContext
2929

3030
protected String _currentName;
3131

32+
/**
33+
* @since 2.9
34+
*/
35+
protected Object _currentValue;
36+
3237
protected Set<String> _namesToWrap;
3338

3439
/**
3540
* Name of property that requires wrapping
3641
*/
3742
protected String _wrappedName;
38-
43+
3944
/*
4045
/**********************************************************
4146
/* Simple instance reuse slots; speeds up things
@@ -70,10 +75,25 @@ protected final void reset(int type, int lineNr, int colNr)
7075
_lineNr = lineNr;
7176
_columnNr = colNr;
7277
_currentName = null;
78+
_currentValue = null;
7379
_namesToWrap = null;
7480
}
75-
76-
// // // Factory methods
81+
82+
@Override
83+
public Object getCurrentValue() {
84+
return _currentValue;
85+
}
86+
87+
@Override
88+
public void setCurrentValue(Object v) {
89+
_currentValue = v;
90+
}
91+
92+
/*
93+
/**********************************************************
94+
/* Factory methods
95+
/**********************************************************
96+
*/
7797

7898
public static XmlReadContext createRootContext(int lineNr, int colNr) {
7999
return new XmlReadContext(null, TYPE_ROOT, lineNr, colNr);

0 commit comments

Comments
 (0)