mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
1 parent
14555063bb
commit
d329570ac8
12 files changed
+447
-140
No files matched your search
@@ -14,8 +14,6 @@ import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
|
||||
/**
|
||||
* Class stores configuration of javascript modules that can be used across the bridge
|
||||
*/
|
||||
@@ -31,29 +29,29 @@ public class JavaScriptModulesConfig {
|
||||
return mModules;
|
||||
}
|
||||
|
||||
public void writeModuleDescriptions(JsonGenerator jg) throws IOException {
|
||||
jg.writeStartObject();
|
||||
public void writeModuleDescriptions(JsonWriter writer) throws IOException {
|
||||
writer.beginObject();
|
||||
for (JavaScriptModuleRegistration registration : mModules) {
|
||||
jg.writeObjectFieldStart(registration.getName());
|
||||
appendJSModuleToJSONObject(jg, registration);
|
||||
jg.writeEndObject();
|
||||
writer.name(registration.getName()).beginObject();
|
||||
appendJSModuleToJSONObject(writer, registration);
|
||||
writer.endObject();
|
||||
}
|
||||
jg.writeEndObject();
|
||||
writer.endObject();
|
||||
}
|
||||
|
||||
private void appendJSModuleToJSONObject(
|
||||
JsonGenerator jg,
|
||||
JsonWriter writer,
|
||||
JavaScriptModuleRegistration registration) throws IOException {
|
||||
jg.writeObjectField("moduleID", registration.getModuleId());
|
||||
jg.writeObjectFieldStart("methods");
|
||||
writer.name("moduleID").value(registration.getModuleId());
|
||||
writer.name("methods").beginObject();
|
||||
for (Method method : registration.getMethods()) {
|
||||
jg.writeObjectFieldStart(method.getName());
|
||||
jg.writeObjectField("methodID", registration.getMethodId(method));
|
||||
jg.writeEndObject();
|
||||
writer.name(method.getName()).beginObject();
|
||||
writer.name("methodID").value(registration.getMethodId(method));
|
||||
writer.endObject();
|
||||
}
|
||||
jg.writeEndObject();
|
||||
writer.endObject();
|
||||
if (registration.getModuleInterface().isAnnotationPresent(SupportsWebWorkers.class)) {
|
||||
jg.writeBooleanField("supportsWebWorkers", true);
|
||||
writer.name("supportsWebWorkers").value(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user