Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ protected void _releaseBuffers() {
* that starts the current token.
*/
@Override
public JsonLocation currentTokenLocation() {
public TokenStreamLocation currentTokenLocation() {
return _xmlTokens.getTokenLocation();
}

Expand All @@ -357,7 +357,7 @@ public JsonLocation currentTokenLocation() {
* usually for error reporting purposes
*/
@Override
public JsonLocation currentLocation() {
public TokenStreamLocation currentLocation() {
return _xmlTokens.getCurrentLocation();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ public final XmlReadContext createChildObjectContext(int lineNr, int colNr)
* start marker was found
*/
@Override
public final JsonLocation startLocation(ContentReference srcRef) {
public final TokenStreamLocation startLocation(ContentReference srcRef) {
// We don't keep track of offsets at this level (only reader does)
long totalChars = -1L;

return new JsonLocation(srcRef, totalChars, _lineNr, _columnNr);
return new TokenStreamLocation(srcRef, totalChars, _lineNr, _columnNr);
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.codehaus.stax2.XMLStreamLocation2;
import org.codehaus.stax2.XMLStreamReader2;

import tools.jackson.core.JsonLocation;
import tools.jackson.core.TokenStreamLocation;
import tools.jackson.core.io.ContentReference;

import tools.jackson.dataformat.xml.XmlNameProcessor;
Expand Down Expand Up @@ -286,7 +286,7 @@ public int next() throws XMLStreamException
}

private String _loc() {
JsonLocation loc = getCurrentLocation();
TokenStreamLocation loc = currentLocation();
return String.format("[line: %d, column: %d]", loc.getLineNr(), loc.getColumnNr());
}
*/
Expand Down Expand Up @@ -346,11 +346,11 @@ public void close() throws XMLStreamException {
_xmlReader.close();
}

public JsonLocation getCurrentLocation() {
public TokenStreamLocation getCurrentLocation() {
return _extractLocation(_xmlReader.getLocationInfo().getCurrentLocation());
}

public JsonLocation getTokenLocation() {
public TokenStreamLocation getTokenLocation() {
return _extractLocation(_xmlReader.getLocationInfo().getStartLocation());
}

Expand Down Expand Up @@ -820,12 +820,12 @@ private final int _handleEndElement()
return (_currentState = XML_END_ELEMENT);
}

private JsonLocation _extractLocation(XMLStreamLocation2 location)
private TokenStreamLocation _extractLocation(XMLStreamLocation2 location)
{
if (location == null) { // just for impls that might pass null...
return new JsonLocation(_sourceReference, -1, -1, -1);
return new TokenStreamLocation(_sourceReference, -1, -1, -1);
}
return new JsonLocation(_sourceReference,
return new TokenStreamLocation(_sourceReference,
location.getCharacterOffset(),
location.getLineNumber(),
location.getColumnNumber());
Expand Down