Skip to content

Commit

Permalink
Update WriterBasedJsonGenerator.java
Browse files Browse the repository at this point in the history
The protected method removes the final to allow users to rewrite the method and implement their own logic
  • Loading branch information
zhangOranges committed Jun 13, 2024
1 parent 7469684 commit d29a4a2
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
public class WriterBasedJsonGenerator
extends JsonGeneratorImpl
{
protected final static int SHORT_WRITE = 32;
protected static int SHORT_WRITE = 32;

protected final static char[] HEX_CHARS_UPPER = CharTypes.copyHexChars(true);
protected final static char[] HEX_CHARS_LOWER = CharTypes.copyHexChars(false);
protected static char[] HEX_CHARS_UPPER = CharTypes.copyHexChars(true);
protected static char[] HEX_CHARS_LOWER = CharTypes.copyHexChars(false);

private char[] getHexChars() {
return _cfgWriteHexUppercase ? HEX_CHARS_UPPER : HEX_CHARS_LOWER;
Expand Down Expand Up @@ -166,7 +166,7 @@ public void writeFieldName(SerializableString name) throws IOException
_writeFieldName(name, (status == JsonWriteContext.STATUS_OK_AFTER_COMMA));
}

protected final void _writeFieldName(String name, boolean commaBefore) throws IOException
protected void _writeFieldName(String name, boolean commaBefore) throws IOException
{
if (_cfgPrettyPrinter != null) {
_writePPFieldName(name, commaBefore);
Expand Down Expand Up @@ -195,7 +195,7 @@ protected final void _writeFieldName(String name, boolean commaBefore) throws IO
_outputBuffer[_outputTail++] = _quoteChar;
}

protected final void _writeFieldName(SerializableString name, boolean commaBefore) throws IOException
protected void _writeFieldName(SerializableString name, boolean commaBefore) throws IOException
{
if (_cfgPrettyPrinter != null) {
_writePPFieldName(name, commaBefore);
Expand Down Expand Up @@ -368,7 +368,7 @@ public void writeEndObject() throws IOException

// Specialized version of <code>_writeFieldName</code>, off-lined
// to keep the "fast path" as simple (and hopefully fast) as possible.
protected final void _writePPFieldName(String name, boolean commaBefore) throws IOException
protected void _writePPFieldName(String name, boolean commaBefore) throws IOException
{
if (commaBefore) {
_cfgPrettyPrinter.writeObjectEntrySeparator(this);
Expand All @@ -391,7 +391,7 @@ protected final void _writePPFieldName(String name, boolean commaBefore) throws
}
}

protected final void _writePPFieldName(SerializableString name, boolean commaBefore) throws IOException
protected void _writePPFieldName(SerializableString name, boolean commaBefore) throws IOException
{
if (commaBefore) {
_cfgPrettyPrinter.writeObjectEntrySeparator(this);
Expand Down Expand Up @@ -939,7 +939,7 @@ public void writeNull() throws IOException {
*/

@Override
protected final void _verifyValueWrite(String typeMsg) throws IOException
protected void _verifyValueWrite(String typeMsg) throws IOException
{
final int status = _writeContext.writeValue();
if (_cfgPrettyPrinter != null) {
Expand Down Expand Up @@ -1586,7 +1586,7 @@ private void _writeStringCustom(char[] text, int offset, int len)
/**********************************************************
*/

protected final void _writeBinary(Base64Variant b64variant, byte[] input, int inputPtr, final int inputEnd)
protected void _writeBinary(Base64Variant b64variant, byte[] input, int inputPtr, final int inputEnd)
throws IOException, JsonGenerationException
{
// Encoding is by chunks of 3 input, 4 output chars, so:
Expand Down Expand Up @@ -1628,7 +1628,7 @@ protected final void _writeBinary(Base64Variant b64variant, byte[] input, int in
}

// write-method called when length is definitely known
protected final int _writeBinary(Base64Variant b64variant,
protected int _writeBinary(Base64Variant b64variant,
InputStream data, byte[] readBuffer, int bytesLeft)
throws IOException, JsonGenerationException
{
Expand Down Expand Up @@ -1688,7 +1688,7 @@ protected final int _writeBinary(Base64Variant b64variant,
}

// write method when length is unknown
protected final int _writeBinary(Base64Variant b64variant,
protected int _writeBinary(Base64Variant b64variant,
InputStream data, byte[] readBuffer)
throws IOException, JsonGenerationException
{
Expand Down

0 comments on commit d29a4a2

Please sign in to comment.