Skip to content

Commit

Permalink
Proper enum rendering.
Browse files Browse the repository at this point in the history
  • Loading branch information
aectann committed May 4, 2012
1 parent f8db000 commit e5c108d
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -18,7 +18,12 @@ public Class getClassToRender() {
return Enum.class;
}
public IJsonWriter toJson(IJsonWriter jsonWriter, Enum o) {
return jsonWriter.append(o.name());
if (jsonWriter.isInKeyMode()) {
jsonWriter.key(o.toString());
} else {
jsonWriter.value(o.toString());
}
return jsonWriter;
}

public <K> K fromJson(Class<K> clazz, Object value, Object...parameters) {
Expand Down

0 comments on commit e5c108d

Please sign in to comment.