Skip to content

Commit

Permalink
improved compatible for 1.x, for issue #2450
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Apr 20, 2024
1 parent 5c4be2b commit 380bebc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,12 @@ public final void decrementIdent() {

public void println() {
}

public void setContext(SerialContext parent, Object object, Object fieldName, int features) {
this.setContext(parent, object, fieldName, features, 0);
}

public void setContext(SerialContext parent, Object object, Object fieldName, int features, int fieldFeatures) {
this.setContext(new SerialContext(parent, object, fieldName, features, fieldFeatures));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,16 @@ public SerializeWriter append(char c) {
public JSONWriter getJSONWriter() {
return raw;
}

public SerializeWriter append(CharSequence csq) {
String s = (csq == null ? "null" : csq.toString());
raw.writeRaw(s);
return this;
}

public SerializeWriter append(CharSequence csq, int start, int end) {
String s = (csq == null ? "null" : csq).subSequence(start, end).toString();
raw.writeRaw(s);
return this;
}
}

0 comments on commit 380bebc

Please sign in to comment.