Skip to content

Commit a817b07

Browse files
authored
Changes for core/1364, renaming of JsonLocation as TokenStreamLocation (#689)
1 parent 3676be9 commit a817b07

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/main/java/tools/jackson/dataformat/xml/deser/FromXmlParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ protected void _releaseBuffers() {
348348
* that starts the current token.
349349
*/
350350
@Override
351-
public JsonLocation currentTokenLocation() {
351+
public TokenStreamLocation currentTokenLocation() {
352352
return _xmlTokens.getTokenLocation();
353353
}
354354

@@ -357,7 +357,7 @@ public JsonLocation currentTokenLocation() {
357357
* usually for error reporting purposes
358358
*/
359359
@Override
360-
public JsonLocation currentLocation() {
360+
public TokenStreamLocation currentLocation() {
361361
return _xmlTokens.getCurrentLocation();
362362
}
363363

src/main/java/tools/jackson/dataformat/xml/deser/XmlReadContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ public final XmlReadContext createChildObjectContext(int lineNr, int colNr)
143143
* start marker was found
144144
*/
145145
@Override
146-
public final JsonLocation startLocation(ContentReference srcRef) {
146+
public final TokenStreamLocation startLocation(ContentReference srcRef) {
147147
// We don't keep track of offsets at this level (only reader does)
148148
long totalChars = -1L;
149149

150-
return new JsonLocation(srcRef, totalChars, _lineNr, _columnNr);
150+
return new TokenStreamLocation(srcRef, totalChars, _lineNr, _columnNr);
151151
}
152152

153153
/*

src/main/java/tools/jackson/dataformat/xml/deser/XmlTokenStream.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import org.codehaus.stax2.XMLStreamLocation2;
99
import org.codehaus.stax2.XMLStreamReader2;
1010

11-
import tools.jackson.core.JsonLocation;
11+
import tools.jackson.core.TokenStreamLocation;
1212
import tools.jackson.core.io.ContentReference;
1313

1414
import tools.jackson.dataformat.xml.XmlNameProcessor;
@@ -286,7 +286,7 @@ public int next() throws XMLStreamException
286286
}
287287
288288
private String _loc() {
289-
JsonLocation loc = getCurrentLocation();
289+
TokenStreamLocation loc = currentLocation();
290290
return String.format("[line: %d, column: %d]", loc.getLineNr(), loc.getColumnNr());
291291
}
292292
*/
@@ -346,11 +346,11 @@ public void close() throws XMLStreamException {
346346
_xmlReader.close();
347347
}
348348

349-
public JsonLocation getCurrentLocation() {
349+
public TokenStreamLocation getCurrentLocation() {
350350
return _extractLocation(_xmlReader.getLocationInfo().getCurrentLocation());
351351
}
352352

353-
public JsonLocation getTokenLocation() {
353+
public TokenStreamLocation getTokenLocation() {
354354
return _extractLocation(_xmlReader.getLocationInfo().getStartLocation());
355355
}
356356

@@ -820,12 +820,12 @@ private final int _handleEndElement()
820820
return (_currentState = XML_END_ELEMENT);
821821
}
822822

823-
private JsonLocation _extractLocation(XMLStreamLocation2 location)
823+
private TokenStreamLocation _extractLocation(XMLStreamLocation2 location)
824824
{
825825
if (location == null) { // just for impls that might pass null...
826-
return new JsonLocation(_sourceReference, -1, -1, -1);
826+
return new TokenStreamLocation(_sourceReference, -1, -1, -1);
827827
}
828-
return new JsonLocation(_sourceReference,
828+
return new TokenStreamLocation(_sourceReference,
829829
location.getCharacterOffset(),
830830
location.getLineNumber(),
831831
location.getColumnNumber());

0 commit comments

Comments
 (0)