-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for JsonGenerator.Key #47
base: master
Are you sure you want to change the base?
Conversation
@@ -150,6 +150,18 @@ private JsonGenerator writeName(String name) { | |||
return this; | |||
} | |||
|
|||
private void writeName(Key name) { | |||
writeComma(); | |||
final char[] escaped = name.toCharArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nb: char[] escaped
includes the quotes
JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope)); | ||
} | ||
writeName(name); | ||
stack.push(currentContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could refactor extract these 4 lines as they are the same as the lines from writeKey(String name)
} | ||
|
||
private static String quoteEscape(CharSequence string) { | ||
StringBuilder builder = new StringBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same escape logic as JsonGeneratorImpl.writeEscapedString()
but writes to the StringBuilder
instead
No description provided.