-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Json Tag Extraction implementation. Migrate from jayway.jsonp…
…ath to jsurfer-core
- Loading branch information
Showing
7 changed files
with
142 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
dd-trace-core/src/main/java/datadog/trace/payloadtags/JsonPosition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package datadog.trace.payloadtags; | ||
|
||
import org.jsfr.json.path.ArrayIndex; | ||
import org.jsfr.json.path.ChildNode; | ||
import org.jsfr.json.path.JsonPath; | ||
import org.jsfr.json.path.PathOperator; | ||
|
||
class JsonPosition extends JsonPath { | ||
|
||
static JsonPosition start() { | ||
return new JsonPosition(); | ||
} | ||
|
||
void stepIntoObject() { | ||
if (operators.length > size) { | ||
PathOperator next = operators[size]; | ||
if (next instanceof ChildNode) { | ||
size++; | ||
((ChildNode) next).setKey(null); | ||
return; | ||
} | ||
} | ||
push(new ChildNode(null)); | ||
} | ||
|
||
void updateObjectEntry(String key) { | ||
((ChildNode) peek()).setKey(key); | ||
} | ||
|
||
void stepOutObject() { | ||
pop(); | ||
} | ||
|
||
void stepIntoArray() { | ||
if (operators.length > size) { | ||
PathOperator next = operators[size]; | ||
if (next instanceof ArrayIndex) { | ||
size++; | ||
((ArrayIndex) next).reset(); | ||
return; | ||
} | ||
} | ||
push(new ArrayIndex()); | ||
} | ||
|
||
boolean accumulateArrayIndex() { | ||
PathOperator top = this.peek(); | ||
if (top.getType() == PathOperator.Type.ARRAY) { | ||
((ArrayIndex) top).increaseArrayIndex(); | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
void stepOutArray() { | ||
pop(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
dd-trace-core/src/main/java/datadog/trace/payloadtags/MoshiJsonProvider.java
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
dd-trace-core/src/main/java/datadog/trace/payloadtags/MoshiMappingProvider.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.