Java 类com.facebook.react.bridge.Dynamic 实例源码

项目:RNLearn_Project1    文件:LayoutShadowNode.java   
void setFromDynamic(Dynamic dynamic) {
  if (dynamic.isNull()) {
    unit = YogaUnit.UNDEFINED;
    value = YogaConstants.UNDEFINED;
  } else if (dynamic.getType() == ReadableType.String) {
    final String s = dynamic.asString();
    if (s.equals("auto")) {
      unit = YogaUnit.AUTO;
      value = YogaConstants.UNDEFINED;
    } else if (s.endsWith("%")) {
      unit = YogaUnit.PERCENT;
      value = Float.parseFloat(s.substring(0, s.length() - 1));
    } else {
      throw new IllegalArgumentException("Unknown value: " + s);
    }
  } else {
    unit = YogaUnit.POINT;
    value = PixelUtil.toPixelFromDIP(dynamic.asDouble());
  }
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactProp(name = ViewProps.WIDTH)
public void setWidth(Dynamic width) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(width);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setStyleWidth(mTempYogaValue.value);
      break;
    case AUTO:
      setStyleWidthAuto();
      break;
    case PERCENT:
      setStyleWidthPercent(mTempYogaValue.value);
      break;
  }

  width.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactProp(name = ViewProps.MIN_WIDTH)
public void setMinWidth(Dynamic minWidth) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(minWidth);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setStyleMinWidth(mTempYogaValue.value);
      break;
    case PERCENT:
      setStyleMinWidthPercent(mTempYogaValue.value);
      break;
  }

  minWidth.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactProp(name = ViewProps.MAX_WIDTH)
public void setMaxWidth(Dynamic maxWidth) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(maxWidth);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setStyleMaxWidth(mTempYogaValue.value);
      break;
    case PERCENT:
      setStyleMaxWidthPercent(mTempYogaValue.value);
      break;
  }

  maxWidth.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactProp(name = ViewProps.HEIGHT)
public void setHeight(Dynamic height) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(height);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setStyleHeight(mTempYogaValue.value);
      break;
    case AUTO:
      setStyleHeightAuto();
      break;
    case PERCENT:
      setStyleHeightPercent(mTempYogaValue.value);
      break;
  }

  height.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactProp(name = ViewProps.MIN_HEIGHT)
public void setMinHeight(Dynamic minHeight) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(minHeight);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setStyleMinHeight(mTempYogaValue.value);
      break;
    case PERCENT:
      setStyleMinHeightPercent(mTempYogaValue.value);
      break;
  }

  minHeight.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactProp(name = ViewProps.MAX_HEIGHT)
public void setMaxHeight(Dynamic maxHeight) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(maxHeight);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setStyleMaxHeight(mTempYogaValue.value);
      break;
    case PERCENT:
      setStyleMaxHeightPercent(mTempYogaValue.value);
      break;
  }

  maxHeight.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactProp(name = ViewProps.FLEX_BASIS)
public void setFlexBasis(Dynamic flexBasis) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(flexBasis);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setFlexBasis(mTempYogaValue.value);
      break;
    case AUTO:
      setFlexBasisAuto();
      break;
    case PERCENT:
      setFlexBasisPercent(mTempYogaValue.value);
      break;
  }

  flexBasis.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactPropGroup(names = {
    ViewProps.LEFT,
    ViewProps.RIGHT,
    ViewProps.TOP,
    ViewProps.BOTTOM,
})
public void setPositionValues(int index, Dynamic position) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(position);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setPosition(ViewProps.POSITION_SPACING_TYPES[index], mTempYogaValue.value);
      break;
    case PERCENT:
      setPositionPercent(ViewProps.POSITION_SPACING_TYPES[index], mTempYogaValue.value);
      break;
  }

  position.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
void setFromDynamic(Dynamic dynamic) {
  if (dynamic.isNull()) {
    unit = YogaUnit.UNDEFINED;
    value = YogaConstants.UNDEFINED;
  } else if (dynamic.getType() == ReadableType.String) {
    final String s = dynamic.asString();
    if (s.equals("auto")) {
      unit = YogaUnit.AUTO;
      value = YogaConstants.UNDEFINED;
    } else if (s.endsWith("%")) {
      unit = YogaUnit.PERCENT;
      value = Float.parseFloat(s.substring(0, s.length() - 1));
    } else {
      throw new IllegalArgumentException("Unknown value: " + s);
    }
  } else {
    unit = YogaUnit.POINT;
    value = PixelUtil.toPixelFromDIP(dynamic.asDouble());
  }
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactProp(name = ViewProps.WIDTH)
public void setWidth(Dynamic width) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(width);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setStyleWidth(mTempYogaValue.value);
      break;
    case AUTO:
      setStyleWidthAuto();
      break;
    case PERCENT:
      setStyleWidthPercent(mTempYogaValue.value);
      break;
  }

  width.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactProp(name = ViewProps.MIN_WIDTH)
public void setMinWidth(Dynamic minWidth) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(minWidth);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setStyleMinWidth(mTempYogaValue.value);
      break;
    case PERCENT:
      setStyleMinWidthPercent(mTempYogaValue.value);
      break;
  }

  minWidth.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactProp(name = ViewProps.MAX_WIDTH)
public void setMaxWidth(Dynamic maxWidth) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(maxWidth);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setStyleMaxWidth(mTempYogaValue.value);
      break;
    case PERCENT:
      setStyleMaxWidthPercent(mTempYogaValue.value);
      break;
  }

  maxWidth.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactProp(name = ViewProps.HEIGHT)
public void setHeight(Dynamic height) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(height);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setStyleHeight(mTempYogaValue.value);
      break;
    case AUTO:
      setStyleHeightAuto();
      break;
    case PERCENT:
      setStyleHeightPercent(mTempYogaValue.value);
      break;
  }

  height.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactProp(name = ViewProps.MIN_HEIGHT)
public void setMinHeight(Dynamic minHeight) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(minHeight);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setStyleMinHeight(mTempYogaValue.value);
      break;
    case PERCENT:
      setStyleMinHeightPercent(mTempYogaValue.value);
      break;
  }

  minHeight.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactProp(name = ViewProps.MAX_HEIGHT)
public void setMaxHeight(Dynamic maxHeight) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(maxHeight);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setStyleMaxHeight(mTempYogaValue.value);
      break;
    case PERCENT:
      setStyleMaxHeightPercent(mTempYogaValue.value);
      break;
  }

  maxHeight.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactProp(name = ViewProps.FLEX_BASIS)
public void setFlexBasis(Dynamic flexBasis) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(flexBasis);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setFlexBasis(mTempYogaValue.value);
      break;
    case AUTO:
      setFlexBasisAuto();
      break;
    case PERCENT:
      setFlexBasisPercent(mTempYogaValue.value);
      break;
  }

  flexBasis.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactPropGroup(names = {
    ViewProps.LEFT,
    ViewProps.RIGHT,
    ViewProps.TOP,
    ViewProps.BOTTOM,
})
public void setPositionValues(int index, Dynamic position) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(position);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setPosition(ViewProps.POSITION_SPACING_TYPES[index], mTempYogaValue.value);
      break;
    case PERCENT:
      setPositionPercent(ViewProps.POSITION_SPACING_TYPES[index], mTempYogaValue.value);
      break;
  }

  position.recycle();
}
项目:react-native-calendar-events    文件:CalendarEvents.java   
@ReactMethod
public void findAllEvents(final Dynamic startDate, final Dynamic endDate, final ReadableArray calendars, final Promise promise) {

    if (this.haveCalendarReadWritePermissions()) {
        try {
            Thread thread = new Thread(new Runnable(){
                @Override
                public void run() {
                    WritableNativeArray results = findEvents(startDate, endDate, calendars);
                    promise.resolve(results);
                }
            });
            thread.start();

        } catch (Exception e) {
            promise.reject("find event error", e.getMessage());
        }
    } else {
        promise.reject("find event error", "you don't have permissions to read an event from the users calendar");
    }

}
项目:RNLearn_Project1    文件:FrescoBasedReactTextInlineImageShadowNode.java   
/**
 * Besides width/height, all other layout props on inline images are ignored
 */
@Override
public void setWidth(Dynamic width) {
  if (width.getType() == ReadableType.Number) {
    mWidth = (float) width.asDouble();
  } else {
    throw new JSApplicationIllegalArgumentException(
        "Inline images must not have percentage based width");
  }
}
项目:RNLearn_Project1    文件:FrescoBasedReactTextInlineImageShadowNode.java   
@Override
public void setHeight(Dynamic height) {
  if (height.getType() == ReadableType.Number) {
    mHeight = (float) height.asDouble();
  } else {
    throw new JSApplicationIllegalArgumentException(
        "Inline images must not have percentage based height");
  }
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactPropGroup(names = {
    ViewProps.MARGIN,
    ViewProps.MARGIN_VERTICAL,
    ViewProps.MARGIN_HORIZONTAL,
    ViewProps.MARGIN_LEFT,
    ViewProps.MARGIN_RIGHT,
    ViewProps.MARGIN_TOP,
    ViewProps.MARGIN_BOTTOM,
})
public void setMargins(int index, Dynamic margin) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(margin);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setMargin(ViewProps.PADDING_MARGIN_SPACING_TYPES[index], mTempYogaValue.value);
      break;
    case AUTO:
      setMarginAuto(ViewProps.PADDING_MARGIN_SPACING_TYPES[index]);
      break;
    case PERCENT:
      setMarginPercent(ViewProps.PADDING_MARGIN_SPACING_TYPES[index], mTempYogaValue.value);
      break;
  }

  margin.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactPropGroup(names = {
    ViewProps.PADDING,
    ViewProps.PADDING_VERTICAL,
    ViewProps.PADDING_HORIZONTAL,
    ViewProps.PADDING_LEFT,
    ViewProps.PADDING_RIGHT,
    ViewProps.PADDING_TOP,
    ViewProps.PADDING_BOTTOM,
})
public void setPaddings(int index, Dynamic padding) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(padding);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setPadding(ViewProps.PADDING_MARGIN_SPACING_TYPES[index], mTempYogaValue.value);
      break;
    case PERCENT:
      setPaddingPercent(ViewProps.PADDING_MARGIN_SPACING_TYPES[index], mTempYogaValue.value);
      break;
  }

  padding.recycle();
}
项目:RNLearn_Project1    文件:ViewManagersPropertyCache.java   
private static PropSetter createPropSetter(
    ReactProp annotation,
    Method method,
    Class<?> propTypeClass) {
  if (propTypeClass == Dynamic.class) {
    return new DynamicPropSetter(annotation, method);
  } else if (propTypeClass == boolean.class) {
    return new BooleanPropSetter(annotation, method, annotation.defaultBoolean());
  } else if (propTypeClass == int.class) {
    return new IntPropSetter(annotation, method, annotation.defaultInt());
  } else if (propTypeClass == float.class) {
    return new FloatPropSetter(annotation, method, annotation.defaultFloat());
  } else if (propTypeClass == double.class) {
    return new DoublePropSetter(annotation, method, annotation.defaultDouble());
  } else if (propTypeClass == String.class) {
    return new StringPropSetter(annotation, method);
  } else if (propTypeClass == Boolean.class) {
    return new BoxedBooleanPropSetter(annotation, method);
  } else if (propTypeClass == Integer.class) {
    return new BoxedIntPropSetter(annotation, method);
  } else if (propTypeClass == ReadableArray.class) {
    return new ArrayPropSetter(annotation, method);
  } else if (propTypeClass == ReadableMap.class) {
    return new MapPropSetter(annotation, method);
  } else {
    throw new RuntimeException("Unrecognized type: " + propTypeClass + " for method: " +
        method.getDeclaringClass().getName() + "#" + method.getName());
  }
}
项目:RNLearn_Project1    文件:CatalystNativeJSToJavaParametersTestCase.java   
public void testDynamicType() {
  mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnDynamicTypes();
  waitForBridgeAndUIIdle();

  List<Dynamic> dynamicCalls = mRecordingTestModule.getDynamicCalls();
  assertEquals(2, dynamicCalls.size());

  assertEquals("foo", dynamicCalls.get(0).asString());
  assertEquals(3.14, dynamicCalls.get(1).asDouble());
}
项目:RNLearn_Project1    文件:FrescoBasedReactTextInlineImageShadowNode.java   
/**
 * Besides width/height, all other layout props on inline images are ignored
 */
@Override
public void setWidth(Dynamic width) {
  if (width.getType() == ReadableType.Number) {
    mWidth = (float) width.asDouble();
  } else {
    throw new JSApplicationIllegalArgumentException(
        "Inline images must not have percentage based width");
  }
}
项目:RNLearn_Project1    文件:FrescoBasedReactTextInlineImageShadowNode.java   
@Override
public void setHeight(Dynamic height) {
  if (height.getType() == ReadableType.Number) {
    mHeight = (float) height.asDouble();
  } else {
    throw new JSApplicationIllegalArgumentException(
        "Inline images must not have percentage based height");
  }
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactPropGroup(names = {
    ViewProps.MARGIN,
    ViewProps.MARGIN_VERTICAL,
    ViewProps.MARGIN_HORIZONTAL,
    ViewProps.MARGIN_LEFT,
    ViewProps.MARGIN_RIGHT,
    ViewProps.MARGIN_TOP,
    ViewProps.MARGIN_BOTTOM,
})
public void setMargins(int index, Dynamic margin) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(margin);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setMargin(ViewProps.PADDING_MARGIN_SPACING_TYPES[index], mTempYogaValue.value);
      break;
    case AUTO:
      setMarginAuto(ViewProps.PADDING_MARGIN_SPACING_TYPES[index]);
      break;
    case PERCENT:
      setMarginPercent(ViewProps.PADDING_MARGIN_SPACING_TYPES[index], mTempYogaValue.value);
      break;
  }

  margin.recycle();
}
项目:RNLearn_Project1    文件:LayoutShadowNode.java   
@ReactPropGroup(names = {
    ViewProps.PADDING,
    ViewProps.PADDING_VERTICAL,
    ViewProps.PADDING_HORIZONTAL,
    ViewProps.PADDING_LEFT,
    ViewProps.PADDING_RIGHT,
    ViewProps.PADDING_TOP,
    ViewProps.PADDING_BOTTOM,
})
public void setPaddings(int index, Dynamic padding) {
  if (isVirtual()) {
    return;
  }

  mTempYogaValue.setFromDynamic(padding);
  switch (mTempYogaValue.unit) {
    case POINT:
    case UNDEFINED:
      setPadding(ViewProps.PADDING_MARGIN_SPACING_TYPES[index], mTempYogaValue.value);
      break;
    case PERCENT:
      setPaddingPercent(ViewProps.PADDING_MARGIN_SPACING_TYPES[index], mTempYogaValue.value);
      break;
  }

  padding.recycle();
}
项目:RNLearn_Project1    文件:ViewManagersPropertyCache.java   
private static PropSetter createPropSetter(
    ReactProp annotation,
    Method method,
    Class<?> propTypeClass) {
  if (propTypeClass == Dynamic.class) {
    return new DynamicPropSetter(annotation, method);
  } else if (propTypeClass == boolean.class) {
    return new BooleanPropSetter(annotation, method, annotation.defaultBoolean());
  } else if (propTypeClass == int.class) {
    return new IntPropSetter(annotation, method, annotation.defaultInt());
  } else if (propTypeClass == float.class) {
    return new FloatPropSetter(annotation, method, annotation.defaultFloat());
  } else if (propTypeClass == double.class) {
    return new DoublePropSetter(annotation, method, annotation.defaultDouble());
  } else if (propTypeClass == String.class) {
    return new StringPropSetter(annotation, method);
  } else if (propTypeClass == Boolean.class) {
    return new BoxedBooleanPropSetter(annotation, method);
  } else if (propTypeClass == Integer.class) {
    return new BoxedIntPropSetter(annotation, method);
  } else if (propTypeClass == ReadableArray.class) {
    return new ArrayPropSetter(annotation, method);
  } else if (propTypeClass == ReadableMap.class) {
    return new MapPropSetter(annotation, method);
  } else {
    throw new RuntimeException("Unrecognized type: " + propTypeClass + " for method: " +
        method.getDeclaringClass().getName() + "#" + method.getName());
  }
}
项目:RNLearn_Project1    文件:CatalystNativeJSToJavaParametersTestCase.java   
public void testDynamicType() {
  mCatalystInstance.getJSModule(TestJSToJavaParametersModule.class).returnDynamicTypes();
  waitForBridgeAndUIIdle();

  List<Dynamic> dynamicCalls = mRecordingTestModule.getDynamicCalls();
  assertEquals(2, dynamicCalls.size());

  assertEquals("foo", dynamicCalls.get(0).asString());
  assertEquals(3.14, dynamicCalls.get(1).asDouble());
}
项目:RNLearn_Project1    文件:ReactStylesDiffMap.java   
@Nullable
public Dynamic getDynamic(String key) {
  return mBackingMap.getDynamic(key);
}
项目:RNLearn_Project1    文件:ViewManagersPropertyCache.java   
private static void createPropSetters(
    ReactPropGroup annotation,
    Method method,
    Class<?> propTypeClass,
    Map<String, PropSetter> props) {
  String[] names = annotation.names();
  if (propTypeClass == Dynamic.class) {
    for (int i = 0; i < names.length; i++) {
      props.put(
          names[i],
          new DynamicPropSetter(annotation, method, i));
    }
  } else if (propTypeClass == int.class) {
    for (int i = 0; i < names.length; i++) {
      props.put(
          names[i],
          new IntPropSetter(annotation, method, i, annotation.defaultInt()));
    }
  } else if (propTypeClass == float.class) {
    for (int i = 0; i < names.length; i++) {
      props.put(
          names[i],
          new FloatPropSetter(annotation, method, i, annotation.defaultFloat()));
    }
  } else if (propTypeClass == double.class) {
    for (int i = 0; i < names.length; i++) {
      props.put(
          names[i],
          new DoublePropSetter(annotation, method, i, annotation.defaultDouble()));
    }
  } else if (propTypeClass == Integer.class) {
    for (int i = 0; i < names.length; i++) {
      props.put(
          names[i],
          new BoxedIntPropSetter(annotation, method, i));
    }
  } else {
    throw new RuntimeException("Unrecognized type: " + propTypeClass + " for method: " +
        method.getDeclaringClass().getName() + "#" + method.getName());
  }
}
项目:RNLearn_Project1    文件:CatalystNativeJSToJavaParametersTestCase.java   
@ReactMethod
public void receiveDynamic(Dynamic dynamic) {
  mDynamicCalls.add(dynamic);
}
项目:RNLearn_Project1    文件:CatalystNativeJSToJavaParametersTestCase.java   
public List<Dynamic> getDynamicCalls() {
  return mDynamicCalls;
}
项目:RNLearn_Project1    文件:ReactStylesDiffMap.java   
@Nullable
public Dynamic getDynamic(String key) {
  return mBackingMap.getDynamic(key);
}
项目:RNLearn_Project1    文件:ViewManagersPropertyCache.java   
private static void createPropSetters(
    ReactPropGroup annotation,
    Method method,
    Class<?> propTypeClass,
    Map<String, PropSetter> props) {
  String[] names = annotation.names();
  if (propTypeClass == Dynamic.class) {
    for (int i = 0; i < names.length; i++) {
      props.put(
          names[i],
          new DynamicPropSetter(annotation, method, i));
    }
  } else if (propTypeClass == int.class) {
    for (int i = 0; i < names.length; i++) {
      props.put(
          names[i],
          new IntPropSetter(annotation, method, i, annotation.defaultInt()));
    }
  } else if (propTypeClass == float.class) {
    for (int i = 0; i < names.length; i++) {
      props.put(
          names[i],
          new FloatPropSetter(annotation, method, i, annotation.defaultFloat()));
    }
  } else if (propTypeClass == double.class) {
    for (int i = 0; i < names.length; i++) {
      props.put(
          names[i],
          new DoublePropSetter(annotation, method, i, annotation.defaultDouble()));
    }
  } else if (propTypeClass == Integer.class) {
    for (int i = 0; i < names.length; i++) {
      props.put(
          names[i],
          new BoxedIntPropSetter(annotation, method, i));
    }
  } else {
    throw new RuntimeException("Unrecognized type: " + propTypeClass + " for method: " +
        method.getDeclaringClass().getName() + "#" + method.getName());
  }
}
项目:RNLearn_Project1    文件:CatalystNativeJSToJavaParametersTestCase.java   
@ReactMethod
public void receiveDynamic(Dynamic dynamic) {
  mDynamicCalls.add(dynamic);
}
项目:RNLearn_Project1    文件:CatalystNativeJSToJavaParametersTestCase.java   
public List<Dynamic> getDynamicCalls() {
  return mDynamicCalls;
}
项目:rn-notification    文件:WritableNativeMap.java   
@Override
public Dynamic getDynamic(String name) {
    return (Dynamic) this.get(name);
}