Get rid of jackson (mostly)

Reviewed By: astreet

Differential Revision: D3041362

fb-gh-sync-id: a7027a08a63730b98dc766b86921820fa3624953
shipit-source-id: a7027a08a63730b98dc766b86921820fa3624953
This commit is contained in:
Alexander Blom
2016-03-17 11:54:18 -07:00
committed by Facebook Github Bot 8
parent 14555063bb
commit d329570ac8
12 changed files with 447 additions and 140 deletions

View File

@@ -9,8 +9,6 @@
package com.facebook.react.bridge;
import com.fasterxml.jackson.core.JsonGenerator;
import com.facebook.infer.annotation.Assertions;
import com.facebook.systrace.Systrace;
@@ -325,20 +323,18 @@ public abstract class BaseJavaModule implements NativeModule {
}
@Override
public final void writeConstantsField(JsonGenerator jg, String fieldName) throws IOException {
public final void writeConstantsField(JsonWriter writer, String fieldName) throws IOException {
Map<String, Object> constants = getConstants();
if (constants == null || constants.isEmpty()) {
return;
}
jg.writeObjectFieldStart(fieldName);
writer.name(fieldName).beginObject();
for (Map.Entry<String, Object> constant : constants.entrySet()) {
JsonGeneratorHelper.writeObjectField(
jg,
constant.getKey(),
constant.getValue());
writer.name(constant.getKey());
JsonWriterHelper.value(writer, constant.getValue());
}
jg.writeEndObject();
writer.endObject();
}
@Override