本文整理匯總了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<>();
}