mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-15 02:17:18 +01:00
105 lines
4 KiB
Java
105 lines
4 KiB
Java
package com.fasterxml.jackson.databind.util;
|
|
|
|
import com.fasterxml.jackson.core.JsonLocation;
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
import com.fasterxml.jackson.core.JsonStreamContext;
|
|
import com.fasterxml.jackson.core.io.ContentReference;
|
|
import com.fasterxml.jackson.core.json.JsonReadContext;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes7.dex */
|
|
public class TokenBufferReadContext extends JsonStreamContext {
|
|
protected String _currentName;
|
|
protected Object _currentValue;
|
|
protected final JsonStreamContext _parent;
|
|
protected final JsonLocation _startLocation;
|
|
|
|
public TokenBufferReadContext(JsonStreamContext jsonStreamContext, ContentReference contentReference) {
|
|
super(jsonStreamContext);
|
|
this._parent = jsonStreamContext.getParent();
|
|
this._currentName = jsonStreamContext.getCurrentName();
|
|
this._currentValue = jsonStreamContext.getCurrentValue();
|
|
if (jsonStreamContext instanceof JsonReadContext) {
|
|
this._startLocation = ((JsonReadContext) jsonStreamContext).startLocation(contentReference);
|
|
} else {
|
|
this._startLocation = JsonLocation.NA;
|
|
}
|
|
}
|
|
|
|
public static TokenBufferReadContext createRootContext(JsonStreamContext jsonStreamContext) {
|
|
return jsonStreamContext == null ? new TokenBufferReadContext() : new TokenBufferReadContext(jsonStreamContext, ContentReference.unknown());
|
|
}
|
|
|
|
public TokenBufferReadContext createChildArrayContext() {
|
|
this._index++;
|
|
return new TokenBufferReadContext(this, 1, -1);
|
|
}
|
|
|
|
public TokenBufferReadContext createChildObjectContext() {
|
|
this._index++;
|
|
return new TokenBufferReadContext(this, 2, -1);
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.JsonStreamContext
|
|
public String getCurrentName() {
|
|
return this._currentName;
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.JsonStreamContext
|
|
public Object getCurrentValue() {
|
|
return this._currentValue;
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.JsonStreamContext
|
|
public JsonStreamContext getParent() {
|
|
return this._parent;
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.JsonStreamContext
|
|
public boolean hasCurrentName() {
|
|
return this._currentName != null;
|
|
}
|
|
|
|
public TokenBufferReadContext parentOrCopy() {
|
|
JsonStreamContext jsonStreamContext = this._parent;
|
|
return jsonStreamContext instanceof TokenBufferReadContext ? (TokenBufferReadContext) jsonStreamContext : jsonStreamContext == null ? new TokenBufferReadContext() : new TokenBufferReadContext(jsonStreamContext, this._startLocation);
|
|
}
|
|
|
|
public void setCurrentName(String str) throws JsonProcessingException {
|
|
this._currentName = str;
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.JsonStreamContext
|
|
public void setCurrentValue(Object obj) {
|
|
this._currentValue = obj;
|
|
}
|
|
|
|
public void updateForValue() {
|
|
this._index++;
|
|
}
|
|
|
|
@Deprecated
|
|
public TokenBufferReadContext(JsonStreamContext jsonStreamContext, Object obj) {
|
|
this(jsonStreamContext, obj instanceof ContentReference ? (ContentReference) obj : ContentReference.rawReference(obj));
|
|
}
|
|
|
|
public TokenBufferReadContext(JsonStreamContext jsonStreamContext, JsonLocation jsonLocation) {
|
|
super(jsonStreamContext);
|
|
this._parent = jsonStreamContext.getParent();
|
|
this._currentName = jsonStreamContext.getCurrentName();
|
|
this._currentValue = jsonStreamContext.getCurrentValue();
|
|
this._startLocation = jsonLocation;
|
|
}
|
|
|
|
public TokenBufferReadContext() {
|
|
super(0, -1);
|
|
this._parent = null;
|
|
this._startLocation = JsonLocation.NA;
|
|
}
|
|
|
|
public TokenBufferReadContext(TokenBufferReadContext tokenBufferReadContext, int i, int i2) {
|
|
super(i, i2);
|
|
this._parent = tokenBufferReadContext;
|
|
this._startLocation = tokenBufferReadContext._startLocation;
|
|
}
|
|
}
|