com.alibaba.fastjson2.JSONPathSegment Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fastjson2 Show documentation
Show all versions of fastjson2 Show documentation
Fastjson is a JSON processor (JSON parser + JSON generator) written in Java
The newest version!
package com.alibaba.fastjson2;
abstract class JSONPathSegment {
public abstract void eval(JSONPath.Context context);
static final class SelfSegment
extends JSONPathSegment {
static final SelfSegment INSTANCE = new SelfSegment();
protected SelfSegment() {
}
@Override
public void eval(JSONPath.Context context) {
context.value = context.parent == null
? context.root
: context.parent.value;
}
}
}