org.robovm.rt.bro.annotation.Bridge.symbol()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中org.robovm.rt.bro.annotation.Bridge.symbol()方法的一些代码示例,展示了Bridge.symbol()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bridge.symbol()方法的具体详情如下:
包路径:org.robovm.rt.bro.annotation.Bridge
类名称:Bridge
方法名:symbol

Bridge.symbol介绍

暂无

代码示例

代码示例来源:origin: robovm/robovm

public static long resolveBridge(Library library, Bridge bridge, Method method) {
  if (library == null) {
    throw new IllegalArgumentException("No @" + Library.class.getName() 
        + " annotation found on class " + method.getDeclaringClass().getName());
  }
  
  long handle = getHandle(library.value());
  String symbol = bridge.symbol();
  if (symbol == null || "".equals(symbol)) {
    symbol = method.getName();
  }
  long f = Dl.resolve(handle, symbol);
  if (f == 0L) {
    f = Dl.resolve(handle, UNHIDDEN_SYMBOL_PREFIX + symbol);
  }
  if (f == 0L && !bridge.optional()) {
    throw new UnsatisfiedLinkError("Failed to resolve native function '" + symbol + "' " 
        + "for method " + method + " with @Bridge annotation " + bridge 
        + " in library " + library);
  }
  return f;
}

代码示例来源:origin: robovm/robovm

public static void bind(Class<?> c) {
  for (Method method : c.getDeclaredMethods()) {
    Bridge bridge = method.getAnnotation(Bridge.class);
    if (bridge != null && (bridge.symbol() == null || "".equals(bridge.symbol()))) {
      Class<?>[] paramTypes = method.getParameterTypes();
      if (paramTypes.length >= 2) {

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

public static long resolveBridge(Library library, Bridge bridge, Method method) {
  if (library == null) {
    throw new IllegalArgumentException("No @" + Library.class.getName() 
        + " annotation found on class " + method.getDeclaringClass().getName());
  }
  
  long handle = getHandle(library.value());
  String symbol = bridge.symbol();
  if (symbol == null || "".equals(symbol)) {
    symbol = method.getName();
  }
  long f = Dl.resolve(handle, symbol);
  if (f == 0L) {
    f = Dl.resolve(handle, UNHIDDEN_SYMBOL_PREFIX + symbol);
  }
  if (f == 0L && !bridge.optional()) {
    throw new UnsatisfiedLinkError("Failed to resolve native function '" + symbol + "' " 
        + "for method " + method + " with @Bridge annotation " + bridge 
        + " in library " + library);
  }
  return f;
}

代码示例来源:origin: MobiVM/robovm

public static long resolveBridge(Library library, Bridge bridge, Method method) {
  if (library == null) {
    throw new IllegalArgumentException("No @" + Library.class.getName() 
        + " annotation found on class " + method.getDeclaringClass().getName());
  }
  
  long handle = getHandle(library.value());
  String symbol = bridge.symbol();
  if (symbol == null || "".equals(symbol)) {
    symbol = method.getName();
  }
  long f = Dl.resolve(handle, symbol);
  if (f == 0L) {
    f = Dl.resolve(handle, UNHIDDEN_SYMBOL_PREFIX + symbol);
  }
  if (f == 0L && !bridge.optional()) {
    throw new UnsatisfiedLinkError("Failed to resolve native function '" + symbol + "' " 
        + "for method " + method + " with @Bridge annotation " + bridge 
        + " in library " + library);
  }
  return f;
}

代码示例来源:origin: com.gluonhq/robovm-objc

public static void bind(Class<?> c) {
  for (Method method : c.getDeclaredMethods()) {
    Bridge bridge = method.getAnnotation(Bridge.class);
    if (bridge != null && (bridge.symbol() == null || "".equals(bridge.symbol()))) {
      Class<?>[] paramTypes = method.getParameterTypes();
      if (paramTypes.length >= 2) {

代码示例来源:origin: FlexoVM/flexovm

public static long resolveBridge(Library library, Bridge bridge, Method method) {
  if (library == null) {
    throw new IllegalArgumentException("No @" + Library.class.getName() 
        + " annotation found on class " + method.getDeclaringClass().getName());
  }
  
  long handle = getHandle(library.value());
  String symbol = bridge.symbol();
  if (symbol == null || "".equals(symbol)) {
    symbol = method.getName();
  }
  long f = Dl.resolve(handle, symbol);
  if (f == 0L) {
    f = Dl.resolve(handle, UNHIDDEN_SYMBOL_PREFIX + symbol);
  }
  if (f == 0L && !bridge.optional()) {
    throw new UnsatisfiedLinkError("Failed to resolve native function '" + symbol + "' " 
        + "for method " + method + " with @Bridge annotation " + bridge 
        + " in library " + library);
  }
  return f;
}

代码示例来源:origin: com.gluonhq/robovm-rt

public static long resolveBridge(Library library, Bridge bridge, Method method) {
  if (library == null) {
    throw new IllegalArgumentException("No @" + Library.class.getName() 
        + " annotation found on class " + method.getDeclaringClass().getName());
  }
  
  long handle = getHandle(library.value());
  String symbol = bridge.symbol();
  if (symbol == null || "".equals(symbol)) {
    symbol = method.getName();
  }
  long f = Dl.resolve(handle, symbol);
  if (f == 0L) {
    f = Dl.resolve(handle, UNHIDDEN_SYMBOL_PREFIX + symbol);
  }
  if (f == 0L && !bridge.optional()) {
    throw new UnsatisfiedLinkError("Failed to resolve native function '" + symbol + "' " 
        + "for method " + method + " with @Bridge annotation " + bridge 
        + " in library " + library);
  }
  return f;
}

代码示例来源:origin: org.robovm/robovm-rt-common

public static long resolveBridge(Library library, Bridge bridge, Method method) {
  if (library == null) {
    throw new IllegalArgumentException("No @" + Library.class.getName() 
        + " annotation found on class " + method.getDeclaringClass().getName());
  }
  
  long handle = getHandle(library.value());
  String symbol = bridge.symbol();
  if (symbol == null || "".equals(symbol)) {
    symbol = method.getName();
  }
  long f = Dl.resolve(handle, symbol);
  if (f == 0L) {
    f = Dl.resolve(handle, UNHIDDEN_SYMBOL_PREFIX + symbol);
  }
  if (f == 0L && !bridge.optional()) {
    throw new UnsatisfiedLinkError("Failed to resolve native function '" + symbol + "' " 
        + "for method " + method + " with @Bridge annotation " + bridge 
        + " in library " + library);
  }
  return f;
}

相关文章