-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrame.java
More file actions
19 lines (16 loc) · 807 Bytes
/
Frame.java
File metadata and controls
19 lines (16 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package json.java21.jtd;
import jdk.sandbox.java.util.json.JsonValue;
/// Stack frame for iterative validation with path and offset tracking
record Frame(JtdSchema schema, JsonValue instance, String ptr, Crumbs crumbs, String discriminatorKey) {
/// Constructor for normal validation without discriminator context
Frame(JtdSchema schema, JsonValue instance, String ptr, Crumbs crumbs) {
this(schema, instance, ptr, crumbs, null);
}
@Override
public String toString() {
final var kind = schema.getClass().getSimpleName();
final var tag = (schema instanceof JtdSchema.RefSchema r) ? "(ref=" + r.ref() + ")" : "";
return "Frame[schema=" + kind + tag + ", instance=" + instance + ", ptr=" + ptr +
", crumbs=" + crumbs + ", discriminatorKey=" + discriminatorKey + "]";
}
}