本文整理了Java中org.robovm.rt.bro.annotation.Bridge
类的一些代码示例,展示了Bridge
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bridge
类的具体详情如下:
包路径:org.robovm.rt.bro.annotation.Bridge
类名称:Bridge
暂无
代码示例来源:origin: robovm/robovm
/**
* @since Available in iOS 3.0 and later.
*/
@Bridge(symbol="CFStringTokenizerAdvanceToNextToken", optional=true)
public native CFStringTokenizerTokenType advanceToNextToken();
/**
代码示例来源: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) {
Library library = c.getAnnotation(Library.class);
if (library != null) {
Runtime.loadLibrary(library);
}
for (Method method : c.getDeclaredMethods()) {
Bridge bridge = method.getAnnotation(Bridge.class);
if (bridge != null && !bridge.dynamic() && !VM.isBridgeMethodBound(method)) {
long f = Runtime.resolveBridge(library, bridge, method);
if (f != 0L) {
VM.bindBridgeMethod(method, f);
}
} else {
GlobalValue globalValue = method.getAnnotation(GlobalValue.class);
if (globalValue != null && !VM.isBridgeMethodBound(method)) {
long f = Runtime.resolveGlobalValue(library, globalValue, method);
if (f != 0L) {
VM.bindBridgeMethod(method, 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: 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: MobiVM/robovm
public static void bind(Class<?> c) {
Library library = c.getAnnotation(Library.class);
if (library != null) {
Runtime.loadLibrary(library);
}
for (Method method : c.getDeclaredMethods()) {
Bridge bridge = method.getAnnotation(Bridge.class);
if (bridge != null && !bridge.dynamic() && !VM.isBridgeMethodBound(method)) {
long f = Runtime.resolveBridge(library, bridge, method);
if (f != 0L) {
VM.bindBridgeMethod(method, f);
}
} else {
GlobalValue globalValue = method.getAnnotation(GlobalValue.class);
if (globalValue != null && !VM.isBridgeMethodBound(method)) {
long f = Runtime.resolveGlobalValue(library, globalValue, method);
if (f != 0L) {
VM.bindBridgeMethod(method, 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: robovm/robovm
/**
* @since Available in iOS 2.0 and later.
*/
@Bridge(symbol="AudioServicesPlaySystemSound", optional=true)
public static native void playSystemSound(int systemSoundID);
/**
代码示例来源: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: com.gluonhq/robovm-rt
public static void bind(Class<?> c) {
Library library = c.getAnnotation(Library.class);
if (library != null) {
Runtime.loadLibrary(library);
}
for (Method method : c.getDeclaredMethods()) {
Bridge bridge = method.getAnnotation(Bridge.class);
if (bridge != null && !bridge.dynamic() && !VM.isBridgeMethodBound(method)) {
long f = Runtime.resolveBridge(library, bridge, method);
if (f != 0L) {
VM.bindBridgeMethod(method, f);
}
} else {
GlobalValue globalValue = method.getAnnotation(GlobalValue.class);
if (globalValue != null && !VM.isBridgeMethodBound(method)) {
long f = Runtime.resolveGlobalValue(library, globalValue, method);
if (f != 0L) {
VM.bindBridgeMethod(method, f);
}
}
}
}
}
代码示例来源:origin: robovm/robovm
/**
* @since Available in iOS 2.0 and later.
*/
@Bridge(symbol="CFTimeZoneGetNextDaylightSavingTimeTransition", optional=true)
public native double getNextDaylightSavingTimeTransition(double at);
/**
代码示例来源: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;
}
代码示例来源:origin: org.robovm/robovm-rt-common
public static void bind(Class<?> c) {
Library library = c.getAnnotation(Library.class);
if (library != null) {
Runtime.loadLibrary(library);
}
for (Method method : c.getDeclaredMethods()) {
Bridge bridge = method.getAnnotation(Bridge.class);
if (bridge != null && !bridge.dynamic() && !VM.isBridgeMethodBound(method)) {
long f = Runtime.resolveBridge(library, bridge, method);
if (f != 0L) {
VM.bindBridgeMethod(method, f);
}
} else {
GlobalValue globalValue = method.getAnnotation(GlobalValue.class);
if (globalValue != null && !VM.isBridgeMethodBound(method)) {
long f = Runtime.resolveGlobalValue(library, globalValue, method);
if (f != 0L) {
VM.bindBridgeMethod(method, f);
}
}
}
}
}
代码示例来源:origin: robovm/robovm
/**
* @since Available in iOS 2.1 and later.
*/
@Bridge(symbol="ExtAudioFileWriteAsync", optional=true)
protected native OSStatus writeAsync0(int inNumberFrames, AudioBufferList ioData);
/**
代码示例来源: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: FlexoVM/flexovm
public static void bind(Class<?> c) {
Library library = c.getAnnotation(Library.class);
if (library != null) {
Runtime.loadLibrary(library);
}
for (Method method : c.getDeclaredMethods()) {
Bridge bridge = method.getAnnotation(Bridge.class);
if (bridge != null && !bridge.dynamic() && !VM.isBridgeMethodBound(method)) {
long f = Runtime.resolveBridge(library, bridge, method);
if (f != 0L) {
VM.bindBridgeMethod(method, f);
}
} else {
GlobalValue globalValue = method.getAnnotation(GlobalValue.class);
if (globalValue != null && !VM.isBridgeMethodBound(method)) {
long f = Runtime.resolveGlobalValue(library, globalValue, method);
if (f != 0L) {
VM.bindBridgeMethod(method, f);
}
}
}
}
}
代码示例来源:origin: robovm/robovm
/**
* @since Available in iOS 2.0 and later.
*/
@Bridge(symbol="CGColorSpaceGetBaseColorSpace", optional=true)
public native CGColorSpace getBaseColorSpace();
/**
代码示例来源: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.mobidevelop.robovm/robovm-rt
public static void bind(Class<?> c) {
Library library = c.getAnnotation(Library.class);
if (library != null) {
Runtime.loadLibrary(library);
}
for (Method method : c.getDeclaredMethods()) {
Bridge bridge = method.getAnnotation(Bridge.class);
if (bridge != null && !bridge.dynamic() && !VM.isBridgeMethodBound(method)) {
long f = Runtime.resolveBridge(library, bridge, method);
if (f != 0L) {
VM.bindBridgeMethod(method, f);
}
} else {
GlobalValue globalValue = method.getAnnotation(GlobalValue.class);
if (globalValue != null && !VM.isBridgeMethodBound(method)) {
long f = Runtime.resolveGlobalValue(library, globalValue, method);
if (f != 0L) {
VM.bindBridgeMethod(method, f);
}
}
}
}
}
代码示例来源:origin: robovm/robovm
/**
* @since Available in iOS 2.0 and later.
*/
@Bridge(symbol="AudioFileReadBytes", optional=true)
protected native OSStatus readBytes0(boolean inUseCache, long inStartingByte, IntPtr ioNumBytes, BytePtr outBuffer);
/**
内容来源于网络,如有侵权,请联系作者删除!