File tree Expand file tree Collapse file tree
core/src/main/java/net/roxymc/jserialize/adapter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package net .roxymc .jserialize .adapter ;
2+
3+ import net .roxymc .jserialize .adapter .object .FormatUtils ;
4+ import org .jspecify .annotations .Nullable ;
5+
6+ public class DelegatingReadContext implements ReadContext {
7+ private final ReadContext delegate ;
8+
9+ public DelegatingReadContext (ReadContext delegate ) {
10+ this .delegate = delegate ;
11+ }
12+
13+ public final ReadContext delegate () {
14+ return delegate ;
15+ }
16+
17+ protected ReadContext wrap (ReadContext delegate ) {
18+ return new DelegatingReadContext (delegate );
19+ }
20+
21+ @ Override
22+ public TypeAdapters typeAdapters () {
23+ return delegate .typeAdapters ();
24+ }
25+
26+ @ Override
27+ public @ Nullable Object parent () {
28+ return delegate .parent ();
29+ }
30+
31+ @ Override
32+ public ReadContext withParent (@ Nullable Object parent ) {
33+ return wrap (delegate .withParent (parent ));
34+ }
35+
36+ @ Override
37+ public @ Nullable String key () {
38+ return delegate .key ();
39+ }
40+
41+ @ Override
42+ public ReadContext withKey (@ Nullable String key ) {
43+ return wrap (delegate .withKey (key ));
44+ }
45+
46+ @ Override
47+ public FormatUtils <?> formatUtils () {
48+ return delegate .formatUtils ();
49+ }
50+ }
Original file line number Diff line number Diff line change 1+ package net .roxymc .jserialize .adapter ;
2+
3+ import net .roxymc .jserialize .adapter .object .FormatUtils ;
4+
5+ public class DelegatingWriteContext implements WriteContext {
6+ private final WriteContext delegate ;
7+
8+ protected DelegatingWriteContext (WriteContext delegate ) {
9+ this .delegate = delegate ;
10+ }
11+
12+ public final WriteContext delegate () {
13+ return delegate ;
14+ }
15+
16+ @ Override
17+ public TypeAdapters typeAdapters () {
18+ return delegate .typeAdapters ();
19+ }
20+
21+ @ Override
22+ public FormatUtils <?> formatUtils () {
23+ return delegate .formatUtils ();
24+ }
25+ }
Original file line number Diff line number Diff line change 88
99import java .io .IOException ;
1010
11+ @ ApiStatus .NonExtendable
1112public interface ReadContext {
1213 @ ApiStatus .Internal
1314 static ReadContext of (TypeAdapters typeAdapters , FormatUtils <?> formatUtils ) {
Original file line number Diff line number Diff line change 88
99import java .io .IOException ;
1010
11+ @ ApiStatus .NonExtendable
1112public interface WriteContext {
1213 @ ApiStatus .Internal
1314 static WriteContext of (TypeAdapters typeAdapters , FormatUtils <?> formatUtils ) {
You can’t perform that action at this time.
0 commit comments