Skip to content

Commit 0a003eb

Browse files
committed
Changes for core/1364, JsonLocation->TokenStreamLocation rename
1 parent 5d27867 commit 0a003eb

File tree

9 files changed

+27
-27
lines changed

9 files changed

+27
-27
lines changed

avro/src/main/java/tools/jackson/dataformat/avro/AvroParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,13 @@ public Object getTypeId() throws JacksonException {
180180
*/
181181

182182
@Override
183-
public JsonLocation currentTokenLocation() {
183+
public TokenStreamLocation currentTokenLocation() {
184184
// !!! TODO
185185
return null;
186186
}
187187

188188
@Override
189-
public JsonLocation currentLocation() {
189+
public TokenStreamLocation currentLocation() {
190190
// !!! TODO
191191
return null;
192192
}

cbor/src/main/java/tools/jackson/dataformat/cbor/CBORParser.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,10 @@ public Object streamReadInputSource() {
394394
* but we do have byte offset to specify.
395395
*/
396396
@Override
397-
public JsonLocation currentTokenLocation()
397+
public TokenStreamLocation currentTokenLocation()
398398
{
399399
// token location is correctly managed...
400-
return new JsonLocation(_ioContext.contentReference(),
400+
return new TokenStreamLocation(_ioContext.contentReference(),
401401
_tokenInputTotal, // bytes
402402
-1, -1, (int) _tokenInputTotal); // char offset, line, column
403403
}
@@ -407,10 +407,10 @@ public JsonLocation currentTokenLocation()
407407
* but we do have byte offset to specify.
408408
*/
409409
@Override
410-
public JsonLocation currentLocation()
410+
public TokenStreamLocation currentLocation()
411411
{
412412
final long offset = _currInputProcessed + _inputPtr;
413-
return new JsonLocation(_ioContext.contentReference(),
413+
return new TokenStreamLocation(_ioContext.contentReference(),
414414
offset, // bytes
415415
-1, -1, (int) offset); // char offset, line, column
416416
}
@@ -3790,7 +3790,7 @@ protected void _handleEOF() throws StreamReadException {
37903790
return;
37913791
}
37923792
// Ok; end-marker or fixed-length Array/Object?
3793-
final JsonLocation loc = _streamReadContext.startLocation(_ioContext.contentReference());
3793+
final TokenStreamLocation loc = _streamReadContext.startLocation(_ioContext.contentReference());
37943794
final String startLocDesc = (loc == null) ? "[N/A]" : loc.sourceDescription();
37953795
if (_streamReadContext.hasExpectedLength()) { // specific length
37963796
final int expMore = _streamReadContext.getRemainingExpectedLength();

cbor/src/main/java/tools/jackson/dataformat/cbor/CBORReadContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ public boolean expectMoreValues() {
167167
* start marker was found
168168
*/
169169
@Override
170-
public JsonLocation startLocation(ContentReference srcRef) {
171-
return new JsonLocation(srcRef, 1L, -1, -1);
170+
public TokenStreamLocation startLocation(ContentReference srcRef) {
171+
return new TokenStreamLocation(srcRef, 1L, -1, -1);
172172
}
173173

174174
/*

cbor/src/test/java/tools/jackson/dataformat/cbor/ParserInputStreamTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import java.io.InputStream;
66
import java.io.SequenceInputStream;
77

8-
import tools.jackson.core.JsonLocation;
8+
import tools.jackson.core.TokenStreamLocation;
99
import tools.jackson.core.JsonParser;
1010
import tools.jackson.databind.JsonNode;
1111
import tools.jackson.databind.ObjectMapper;
@@ -47,7 +47,7 @@ public void testInputStreamWithHugeValueThatOverlaps() throws Exception {
4747
parser.nextToken();
4848
parser.finishToken();
4949

50-
final JsonLocation loc = parser.currentLocation();
50+
final TokenStreamLocation loc = parser.currentLocation();
5151
final long start = loc.getByteOffset();
5252
assertEquals(7999, start);
5353

ion/src/main/java/tools/jackson/dataformat/ion/IonParser.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,8 @@ public Object getTypeId() throws JacksonException {
548548
*/
549549

550550
@Override
551-
public JsonLocation currentLocation() {
552-
return JsonLocation.NA;
551+
public TokenStreamLocation currentLocation() {
552+
return TokenStreamLocation.NA;
553553
}
554554

555555
@Override
@@ -562,8 +562,8 @@ public String currentName() throws JacksonException {
562562
@Override public Object currentValue() { return _streamReadContext.currentValue(); }
563563

564564
@Override
565-
public JsonLocation currentTokenLocation() {
566-
return JsonLocation.NA;
565+
public TokenStreamLocation currentTokenLocation() {
566+
return TokenStreamLocation.NA;
567567
}
568568

569569
@Override

protobuf/src/main/java/tools/jackson/dataformat/protobuf/ProtobufParser.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,10 @@ public Object streamReadInputSource() {
391391
* but we do have byte offset to specify.
392392
*/
393393
@Override
394-
public JsonLocation currentTokenLocation()
394+
public TokenStreamLocation currentTokenLocation()
395395
{
396396
// token location is correctly managed...
397-
return new JsonLocation(_ioContext.contentReference(),
397+
return new TokenStreamLocation(_ioContext.contentReference(),
398398
_tokenInputTotal, // bytes
399399
-1, -1, (int) _tokenInputTotal); // char offset, line, column
400400
}
@@ -404,10 +404,10 @@ public JsonLocation currentTokenLocation()
404404
* but we do have byte offset to specify.
405405
*/
406406
@Override
407-
public JsonLocation currentLocation()
407+
public TokenStreamLocation currentLocation()
408408
{
409409
final long offset = _currInputProcessed + _inputPtr;
410-
return new JsonLocation(_ioContext.contentReference(),
410+
return new TokenStreamLocation(_ioContext.contentReference(),
411411
offset, // bytes
412412
-1, -1, (int) offset); // char offset, line, column
413413
}

protobuf/src/main/java/tools/jackson/dataformat/protobuf/ProtobufReadContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ private void _adjustEnd(int bytesConsumed) {
191191
* @return Location pointing to the point where the context
192192
* start marker was found
193193
*/
194-
public JsonLocation startLocation(ContentReference srcRef, long byteOffset) {
194+
public TokenStreamLocation startLocation(ContentReference srcRef, long byteOffset) {
195195
// not much we can tell
196-
return new JsonLocation(srcRef, byteOffset, -1, -1);
196+
return new TokenStreamLocation(srcRef, byteOffset, -1, -1);
197197
}
198198

199199
/*

smile/src/main/java/tools/jackson/dataformat/smile/SmileParserBase.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,12 @@ public final boolean mayContainRawBinary() {
280280
* but we do have byte offset to specify.
281281
*/
282282
@Override
283-
public final JsonLocation currentTokenLocation()
283+
public final TokenStreamLocation currentTokenLocation()
284284
{
285285
// token location is correctly managed...
286286
long total = _currInputProcessed + _tokenOffsetForTotal;
287287
// 2.4: used to be: _tokenInputTotal
288-
return new JsonLocation(_ioContext.contentReference(),
288+
return new TokenStreamLocation(_ioContext.contentReference(),
289289
total, // bytes
290290
-1, -1, (int) total); // char offset, line, column
291291
}
@@ -295,10 +295,10 @@ public final JsonLocation currentTokenLocation()
295295
* but we do have byte offset to specify.
296296
*/
297297
@Override
298-
public final JsonLocation currentLocation()
298+
public final TokenStreamLocation currentLocation()
299299
{
300300
final long offset = _currInputProcessed + _inputPtr;
301-
return new JsonLocation(_ioContext.contentReference(),
301+
return new TokenStreamLocation(_ioContext.contentReference(),
302302
offset, // bytes
303303
-1, -1, (int) offset); // char offset, line, column
304304
}
@@ -700,7 +700,7 @@ protected void _reportMismatchedEndMarker(int actCh, char expCh) throws StreamRe
700700

701701
/**
702702
* Helper method used to encapsulate logic of including (or not) of
703-
* "source reference" when constructing {@link JsonLocation} instances.
703+
* "source reference" when constructing {@link TokenStreamLocation} instances.
704704
*/
705705
protected ContentReference _sourceReference() {
706706
if (isEnabled(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION)) {

smile/src/test/java/tools/jackson/dataformat/smile/parse/ParserLocationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public void testSimpleOffsets() throws IOException
1616

1717
JsonParser p = _smileParser(data);
1818
assertNull(p.currentToken());
19-
JsonLocation loc = p.currentLocation();
19+
TokenStreamLocation loc = p.currentLocation();
2020
assertNotNull(loc);
2121
// first: -1 for "not known", for character-based stuff
2222
assertEquals(-1, loc.getCharOffset());

0 commit comments

Comments
 (0)