Skip to content

Commit

Permalink
Implement jackson field ids
Browse files Browse the repository at this point in the history
  • Loading branch information
brenbar committed Jan 20, 2025
1 parent 3c08b90 commit 84cbc79
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,11 @@ private void writeByteArrayTextKey(byte[] text, int offset, int len) throws IOEx
addValueNode(new String(text, offset, len, DEFAULT_CHARSET));
}

// TODO: Uncomment
//@Override
//public void writeFieldId(long id) throws IOException
//{
// addKeyToStackTop(id);
//}
@Override
public void writeFieldId(long id) throws IOException
{
addKeyNode(id);
}

@Override
public void writeFieldName(String name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,10 +621,10 @@ public String currentName()
return streamReadContext.getCurrentName();
}

// TODO: Uncomment
//public boolean isCurrentFieldId() {
// return this.type == Type.INT || this.type == Type.LONG;
//}
public boolean isCurrentFieldId()
{
return this.type == Type.INT || this.type == Type.LONG;
}

@Override
public String getCurrentName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ public Object deserializeKey(String s, DeserializationContext deserializationCon
JsonParser parser = deserializationContext.getParser();
if (parser instanceof MessagePackParser) {
MessagePackParser p = (MessagePackParser) parser;
// TODO: Uncomment
//if (p.isCurrentFieldId()) {
// return Integer.valueOf(s);
//}
if (p.isCurrentFieldId()) {
return Integer.valueOf(s);
}
}
return s;
}
Expand Down

0 comments on commit 84cbc79

Please sign in to comment.