本文整理汇总了Java中com.facebook.react.bridge.JavaScriptModule类的典型用法代码示例。如果您正苦于以下问题:Java JavaScriptModule类的具体用法?Java JavaScriptModule怎么用?Java JavaScriptModule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JavaScriptModule类属于com.facebook.react.bridge包,在下文中一共展示了JavaScriptModule类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createJSModules
import com.facebook.react.bridge.JavaScriptModule; //导入依赖的package包/类
@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
List<Class<? extends JavaScriptModule>> jsModules = new ArrayList<>(Arrays.asList(
DeviceEventManagerModule.RCTDeviceEventEmitter.class,
JSTimersExecution.class,
RCTEventEmitter.class,
RCTNativeAppEventEmitter.class,
AppRegistry.class,
com.facebook.react.bridge.Systrace.class,
HMRClient.class));
if (ReactBuildConfig.DEBUG) {
jsModules.add(DebugComponentOwnershipModule.RCTDebugComponentOwnership.class);
jsModules.add(JSCHeapCapture.HeapCapture.class);
jsModules.add(JSCSamplingProfiler.SamplingProfiler.class);
}
return jsModules;
}
示例2: processPackage
import com.facebook.react.bridge.JavaScriptModule; //导入依赖的package包/类
private void processPackage(
ReactPackage reactPackage,
NativeModuleRegistryBuilder nativeModuleRegistryBuilder,
JavaScriptModuleRegistry.Builder jsModulesBuilder) {
SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "processPackage")
.arg("className", reactPackage.getClass().getSimpleName())
.flush();
if (reactPackage instanceof ReactPackageLogger) {
((ReactPackageLogger) reactPackage).startProcessPackage();
}
nativeModuleRegistryBuilder.processPackage(reactPackage);
for (Class<? extends JavaScriptModule> jsModuleClass : reactPackage.createJSModules()) {
jsModulesBuilder.add(jsModuleClass);
}
if (reactPackage instanceof ReactPackageLogger) {
((ReactPackageLogger) reactPackage).endProcessPackage();
}
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
}
示例3: testThatCompositeReturnsASumOfJSModules
import com.facebook.react.bridge.JavaScriptModule; //导入依赖的package包/类
@Test
public void testThatCompositeReturnsASumOfJSModules() {
// Given
CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2);
Class<? extends JavaScriptModule> moduleNo1 = mock(JavaScriptModuleNo1.class).getClass();
Class<? extends JavaScriptModule> moduleNo2 = mock(JavaScriptModuleNo2.class).getClass();
Class<? extends JavaScriptModule> moduleNo3 = mock(JavaScriptModuleNo3.class).getClass();
List<Class<? extends JavaScriptModule>> l1 = new ArrayList<>();
l1.add(moduleNo1);
when(packageNo1.createJSModules()).thenReturn(l1);
List<Class<? extends JavaScriptModule>> l2 = new ArrayList<>();
l2.add(moduleNo2);
l2.add(moduleNo3);
when(packageNo2.createJSModules()).thenReturn(l2);
// When
List<Class<? extends JavaScriptModule>> compositeModules = composite.createJSModules();
// Then
// wrapping lists into sets to be order-independent
List<Class<? extends JavaScriptModule>> l3 = new ArrayList<>();
l3.add(moduleNo1);
l3.add(moduleNo2);
l3.add(moduleNo3);
Set<Class<? extends JavaScriptModule>> expected = new HashSet<>(l3);
Set<Class<? extends JavaScriptModule>> actual = new HashSet<>(compositeModules);
assertEquals(expected, actual);
}
示例4: createJSModules
import com.facebook.react.bridge.JavaScriptModule; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>();
for (ReactPackage reactPackage: mChildReactPackages) {
for (Class<? extends JavaScriptModule> jsModule: reactPackage.createJSModules()) {
moduleSet.add(jsModule);
}
}
return new ArrayList(moduleSet);
}
示例5: createJSModules
import com.facebook.react.bridge.JavaScriptModule; //导入依赖的package包/类
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
示例6: createJSModules
import com.facebook.react.bridge.JavaScriptModule; //导入依赖的package包/类
@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
示例7: createJSModules
import com.facebook.react.bridge.JavaScriptModule; //导入依赖的package包/类
@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
示例8: createJSModules
import com.facebook.react.bridge.JavaScriptModule; //导入依赖的package包/类
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
示例9: createJSModules
import com.facebook.react.bridge.JavaScriptModule; //导入依赖的package包/类
@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
return mSpecForTest.getExtraJSModulesForTest();
}
示例10: createJSModules
import com.facebook.react.bridge.JavaScriptModule; //导入依赖的package包/类
public List<Class<? extends JavaScriptModule>> createJSModules()
{
return Collections.emptyList();
}
示例11: createJSModules
import com.facebook.react.bridge.JavaScriptModule; //导入依赖的package包/类
@Override public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
示例12: getJSModule
import com.facebook.react.bridge.JavaScriptModule; //导入依赖的package包/类
@Override
public <T extends JavaScriptModule> T getJSModule(ExecutorToken executorToken, Class<T> jsInterface) {
return Assertions.assertNotNull(mJSModuleRegistry)
.getJavaScriptModule(this, executorToken, jsInterface);
}
示例13: createJSModules
import com.facebook.react.bridge.JavaScriptModule; //导入依赖的package包/类
@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
return new ArrayList<>();
}