com.sun.jna.Function.isVarArgs()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(271)

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

Function.isVarArgs介绍

[英]Varargs are only supported on 1.5+.
[中]Varargs仅在1.5+上受支持。

代码示例

代码示例来源:origin: net.java.dev.jna/jna

/** Chain invocation to the native function. */
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
  if (Library.Handler.OBJECT_TOSTRING.equals(method)) {
    String str = "Proxy interface to " + function;
    Method m = (Method)options.get(Function.OPTION_INVOKING_METHOD);
    Class<?> cls = findCallbackClass(m.getDeclaringClass());
    str += " (" + cls.getName() + ")";
    return str;
  } else if (Library.Handler.OBJECT_HASHCODE.equals(method)) {
    return Integer.valueOf(hashCode());
  } else if (Library.Handler.OBJECT_EQUALS.equals(method)) {
    Object o = args[0];
    if (o != null && Proxy.isProxyClass(o.getClass())) {
      return Function.valueOf(Proxy.getInvocationHandler(o) == this);
    }
    return Boolean.FALSE;
  }
  if (Function.isVarArgs(method)) {
    args = Function.concatenateVarArgs(args);
  }
  return function.invoke(method.getReturnType(), args, options);
}

代码示例来源:origin: net.java.dev.jna/jna

f = functions.get(method);
if (f == null) {
  boolean isVarArgs = Function.isVarArgs(method);
  InvocationHandler handler = null;
  if (invocationMapper != null) {

代码示例来源:origin: net.java.dev.jna/jna

boolean isVarArgs = args.length > 0 && invokingMethod != null ? isVarArgs(invokingMethod) : false;
int fixedArgs = args.length > 0 && invokingMethod != null ? fixedArgs(invokingMethod) : 0;
for (int i=0; i < args.length; i++) {

代码示例来源:origin: com.sun.jna/jna

/** Chain invocation to the native function. */
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
  if (Library.Handler.OBJECT_TOSTRING.equals(method)) {
    return "Proxy interface to " + function;
  }
  else if (Library.Handler.OBJECT_HASHCODE.equals(method)) {
    return new Integer(hashCode());
  }
  else if (Library.Handler.OBJECT_EQUALS.equals(method)) {
    Object o = args[0];
    if (o != null && Proxy.isProxyClass(o.getClass())) {
      return Boolean.valueOf(Proxy.getInvocationHandler(o) == this);
    }
    return Boolean.FALSE;
  }
  if (Function.isVarArgs(method)) {
    args = Function.concatenateVarArgs(args);
  }
  return function.invoke(method.getReturnType(), args, options);
}

代码示例来源:origin: org.elasticsearch/jna

/** Chain invocation to the native function. */
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
  if (Library.Handler.OBJECT_TOSTRING.equals(method)) {
    String str = "Proxy interface to " + function;
    Method m = (Method)options.get(Function.OPTION_INVOKING_METHOD);
    Class<?> cls = findCallbackClass(m.getDeclaringClass());
    str += " (" + cls.getName() + ")";
    return str;
  } else if (Library.Handler.OBJECT_HASHCODE.equals(method)) {
    return Integer.valueOf(hashCode());
  } else if (Library.Handler.OBJECT_EQUALS.equals(method)) {
    Object o = args[0];
    if (o != null && Proxy.isProxyClass(o.getClass())) {
      return Function.valueOf(Proxy.getInvocationHandler(o) == this);
    }
    return Boolean.FALSE;
  }
  if (Function.isVarArgs(method)) {
    args = Function.concatenateVarArgs(args);
  }
  return function.invoke(method.getReturnType(), args, options);
}

代码示例来源:origin: org.elasticsearch/jna

f = functions.get(method);
if (f == null) {
  boolean isVarArgs = Function.isVarArgs(method);
  InvocationHandler handler = null;
  if (invocationMapper != null) {

代码示例来源:origin: com.sun.jna/jna

if (f == null) {
  f = new FunctionInfo();
  f.isVarArgs = Function.isVarArgs(method);
  if (invocationMapper != null) {
    f.handler = invocationMapper.getInvocationHandler(nativeLibrary, method);

代码示例来源:origin: org.elasticsearch/jna

boolean isVarArgs = args.length > 0 && invokingMethod != null ? isVarArgs(invokingMethod) : false;
int fixedArgs = args.length > 0 && invokingMethod != null ? fixedArgs(invokingMethod) : 0;
for (int i=0; i < args.length; i++) {

相关文章