Tabnine Logo
CachedMethod.getReturnType
Code IndexAdd Tabnine to your IDE (free)

How to use
getReturnType
method
in
org.codehaus.groovy.reflection.CachedMethod

Best Java code snippets using org.codehaus.groovy.reflection.CachedMethod.getReturnType (Showing top 20 results out of 315)

origin: org.codehaus.groovy/groovy

public Class getReturnType() {
  return method.getReturnType();
}
origin: org.codehaus.groovy/groovy

public CachedMethod searchMethods(String name, CachedClass[] parameterTypes) {
  CachedMethod[] methods = getMethods();
  CachedMethod res = null;
  for (CachedMethod m : methods) {
    if (m.getName().equals(name)
        && ReflectionCache.arrayContentsEq(parameterTypes, m.getParameterTypes())
        && (res == null || res.getReturnType().isAssignableFrom(m.getReturnType())))
      res = m;
  }
  return res;
}
origin: org.codehaus.groovy/groovy

private int compareToMethod(Method other) {
  if (other == null)
    return -1;
  final int strComp = getName().compareTo(other.getName());
  if (strComp != 0)
    return strComp;
  final int retComp = getReturnType().getName().compareTo(other.getReturnType().getName());
  if (retComp != 0)
    return retComp;
  CachedClass[] params = getParameterTypes();
  Class[] mparams = other.getParameterTypes();
  final int pd = params.length - mparams.length;
  if (pd != 0)
    return pd;
  for (int i = 0; i != params.length; ++i) {
    final int nameComp = params[i].getName().compareTo(mparams[i].getName());
    if (nameComp != 0)
      return nameComp;
  }
  return 0;
}
origin: org.codehaus.groovy/groovy

public String getDescriptor() {
  return BytecodeHelper.getMethodDescriptor(getReturnType(), getNativeParameterTypes());
}
origin: org.codehaus.groovy/groovy

private int compareToCachedMethod(CachedMethod other) {
  if (other == null)
    return -1;
  final int strComp = getName().compareTo(other.getName());
  if (strComp != 0)
    return strComp;
  final int retComp = getReturnType().getName().compareTo(other.getReturnType().getName());
  if (retComp != 0)
    return retComp;
  CachedClass[] params = getParameterTypes();
  CachedClass[] otherParams = other.getParameterTypes();
  final int pd = params.length - otherParams.length;
  if (pd != 0)
    return pd;
  for (int i = 0; i != params.length; ++i) {
    final int nameComp = params[i].getName().compareTo(otherParams[i].getName());
    if (nameComp != 0)
      return nameComp;
  }
  final int classComp = cachedClass.toString().compareTo(other.getDeclaringClass().toString());
  if (classComp != 0)
    return classComp;
  throw new RuntimeException("Should never happen");
}
origin: org.codehaus.groovy/groovy

  continue;
final Class returnType = method.getReturnType();
record.returnType = method.getReturnType();
record.parameters = method.getNativeParameterTypes();
record.className = className;
origin: org.codehaus.groovy/groovy

  /**
   * @return the matching method which should be found
   */
  private MetaMethod findMethod(CachedMethod aMethod) {
    Object methods = getMethods(theClass, aMethod.getName(), false);
    if (methods instanceof FastArray) {
      FastArray m  = (FastArray) methods;
      final int len = m.size;
      final Object data[] = m.getArray();
      for (int i = 0; i != len; ++i) {
        MetaMethod method = (MetaMethod) data[i];
        if (method.isMethod(aMethod)) {
          return method;
        }
      }
    }
    else {
      MetaMethod method = (MetaMethod) methods;
      if (method.getName().equals(aMethod.getName())
//                    TODO: should be better check for case when only diff in modifiers can be SYNTHETIC flag
//                    && method.getModifiers() == aMethod.getModifiers()
          && method.getReturnType().equals(aMethod.getReturnType())
          && MetaMethod.equal(method.getParameterTypes(), aMethod.getParameterTypes())) {
        return method;
      }
    }
    return aMethod;
  }

origin: org.codehaus.groovy/groovy

String descriptor = BytecodeHelper.getMethodDescriptor(cachedMethod.getReturnType(), cachedMethod.getNativeParameterTypes());
BytecodeHelper.box(mv, cachedMethod.getReturnType());
if (cachedMethod.getReturnType() == void.class) {
  mv.visitInsn(Opcodes.ACONST_NULL);
origin: org.codehaus.groovy/groovy

private static void createInvokeMethod(CachedMethod method, ClassWriter cw, Class returnType, String methodDescriptor) {
  MethodVisitor mv;
  mv = cw.visitMethod(ACC_PUBLIC, "invoke", "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;", null, null);
  mv.visitCode();
  mv.visitVarInsn(ALOAD, 1);
  BytecodeHelper.doCast(mv, method.getParameterTypes()[0].getTheClass());
  loadParameters(method, 2, mv);
  mv.visitMethodInsn(INVOKESTATIC, BytecodeHelper.getClassInternalName(method.getDeclaringClass().getTheClass()), method.getName(), methodDescriptor, false);
  BytecodeHelper.box(mv, returnType);
  if (method.getReturnType() == void.class) {
    mv.visitInsn(ACONST_NULL);
  }
  mv.visitInsn(ARETURN);
  mv.visitMaxs(0, 0);
  mv.visitEnd();
}
origin: org.codehaus.groovy/groovy

if (method.getReturnType() == void.class) {
  mv.visitInsn(ACONST_NULL);
origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

public Class getReturnType() {
  return method.getReturnType();
}
origin: org.codehaus.groovy/groovy-jdk14

public Class getReturnType() {
  return method.getReturnType();
}
origin: org.codehaus.groovy/groovy-all-minimal

public Class getReturnType() {
  return method.getReturnType();
}
origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

public CachedMethod searchMethods(String name, CachedClass[] parameterTypes) {
  CachedMethod[] methods = getMethods();
  CachedMethod res = null;
  for (CachedMethod m : methods) {
    if (m.getName().equals(name)
        && ReflectionCache.arrayContentsEq(parameterTypes, m.getParameterTypes())
        && (res == null || res.getReturnType().isAssignableFrom(m.getReturnType())))
      res = m;
  }
  return res;
}
origin: org.kohsuke.droovy/groovy

public CachedMethod searchMethods(String name, CachedClass[] parameterTypes) {
  CachedMethod[] methods = getMethods();
  CachedMethod res = null;
  for (int i = 0; i < methods.length; i++) {
    CachedMethod m = methods[i];
    if (m.getName().equals(name)
        && ReflectionCache.arrayContentsEq(parameterTypes, m.getParameterTypes())
        && (res == null || res.getReturnType().isAssignableFrom(m.getReturnType())))
      res = m;
  }
  return res;
}
origin: org.codehaus.groovy/groovy-all-minimal

public CachedMethod searchMethods(String name, CachedClass[] parameterTypes) {
  CachedMethod[] methods = getMethods();
  CachedMethod res = null;
  for (int i = 0; i < methods.length; i++) {
    CachedMethod m = methods[i];
    if (m.getName().equals(name)
        && ReflectionCache.arrayContentsEq(parameterTypes, m.getParameterTypes())
        && (res == null || res.getReturnType().isAssignableFrom(m.getReturnType())))
      res = m;
  }
  return res;
}
origin: org.codehaus.groovy/groovy-jdk14

public CachedMethod searchMethods(String name, CachedClass[] parameterTypes) {
  CachedMethod[] methods = getMethods();
  CachedMethod res = null;
  for (int i = 0; i < methods.length; i++) {
    CachedMethod m = methods[i];
    if (m.getName().equals(name)
        && ReflectionCache.arrayContentsEq(parameterTypes, m.getParameterTypes())
        && (res == null || res.getReturnType().isAssignableFrom(m.getReturnType())))
      res = m;
  }
  return res;
}
origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

public String getDescriptor() {
  return BytecodeHelper.getMethodDescriptor(getReturnType(), getNativeParameterTypes());
}
origin: org.codehaus.groovy/groovy-jdk14

public String getDescriptor() {
  return BytecodeHelper.getMethodDescriptor(getReturnType(), getNativeParameterTypes());
}
origin: org.codehaus.groovy/groovy-all-minimal

public String getDescriptor() {
  return BytecodeHelper.getMethodDescriptor(getReturnType(), getNativeParameterTypes());
}
org.codehaus.groovy.reflectionCachedMethodgetReturnType

Popular methods of CachedMethod

  • getCachedMethod
  • <init>
  • find
  • isStatic
  • setAccessible
  • compareTo
  • compareToCachedMethod
  • compareToMethod
  • getDeclaringClass
  • getDescriptor
  • getModifiers
  • getName
  • getModifiers,
  • getName,
  • getNativeParameterTypes,
  • getParameterTypes,
  • toString,
  • correctArguments,
  • createPogoMetaMethodSite,
  • createPojoMetaMethodSite,
  • createStaticMetaMethodSite

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • findViewById (Activity)
  • compareTo (BigDecimal)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • JButton (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now