Codota Logo
ClassNode.hasPossibleMethod
Code IndexAdd Codota to your IDE (free)

How to use
hasPossibleMethod
method
in
org.codehaus.groovy.ast.ClassNode

Best Java code snippets using org.codehaus.groovy.ast.ClassNode.hasPossibleMethod (Showing top 12 results out of 315)

  • Common ways to obtain ClassNode
private void myMethod () {
ClassNode c =
  • Codota IconExpression expression;expression.getType()
  • Codota IconMethodNode methodNode;methodNode.getReturnType()
  • Codota IconString name;ClassHelper.make(name)
  • Smart code suggestions by Codota
}
origin: org.codehaus.groovy/groovy

protected boolean isClosureCall(final String name, final Expression objectExpression, final Expression arguments) {
  if (objectExpression instanceof ClosureExpression && ("call".equals(name) || "doCall".equals(name)))
    return true;
  if (objectExpression == VariableExpression.THIS_EXPRESSION) {
    FieldNode fieldNode = typeCheckingContext.getEnclosingClassNode().getDeclaredField(name);
    if (fieldNode != null) {
      ClassNode type = fieldNode.getType();
      if (CLOSURE_TYPE.equals(type) && !typeCheckingContext.getEnclosingClassNode().hasPossibleMethod(name, arguments)) {
        return true;
      }
    }
  } else {
    if (!"call".equals(name) && !"doCall".equals(name)) return false;
  }
  return (getType(objectExpression).equals(CLOSURE_TYPE));
}
origin: org.codehaus.groovy/groovy

private boolean isClosureCall(MethodCallExpression call) {
  // are we a local variable?
  // it should not be an explicitly "this" qualified method call
  // and the current class should have a possible method
  ClassNode classNode = controller.getClassNode();
  String methodName = call.getMethodAsString();
  if (methodName==null) return false;
  if (!call.isImplicitThis()) return false;
  if (!AsmClassGenerator.isThisExpression(call.getObjectExpression())) return false;
  FieldNode field = classNode.getDeclaredField(methodName);
  if (field == null) return false;
  if (isStaticInvocation(call) && !field.isStatic()) return false;
  Expression arguments = call.getArguments();
  return ! classNode.hasPossibleMethod(methodName, arguments);
}
origin: org.codehaus.groovy/groovy

leftFieldName = ((PropertyExpression) leftExpression).getPropertyAsString();
FieldNode fn = tryGetFieldNode(weavedType, leftFieldName);
if (fieldHelper == null || fn == null && !fieldHelper.hasPossibleMethod(Traits.helperSetterName(new FieldNode(leftFieldName, 0, ClassHelper.OBJECT_TYPE, weavedType, null)), rightExpression)) {
  return createAssignmentToField(rightExpression, operation, leftFieldName);
origin: org.codehaus.groovy/groovy

boolean inInnerClass = isInnerClass(currentClass);
if (currentMethod != null && !currentMethod.isStatic()) {
  if (currentClass.hasPossibleMethod(methodName, args)) {
    foundInstanceMethod = true;
  if (currentClass.getOuterClass().hasPossibleMethod(methodName, args)) {
    object = new PropertyExpression(new ClassExpression(currentClass.getOuterClass()), new ConstantExpression("this"));
  } else if (hasPossibleStaticMethod(currentClass.getOuterClass(), methodName, args, true)
origin: org.codehaus.groovy/groovy-all-minimal

private boolean isClosureCall(MethodCallExpression call) {
  // are we a local variable?
  // it should not be an explicitly "this" qualified method call
  // and the current class should have a possible method
  String methodName = call.getMethodAsString();
  if (methodName==null) return false;
  if (!call.isImplicitThis()) return false;
  if (!isThisExpression(call.getObjectExpression())) return false;
  //if (isNotExplicitThisInClosure(call.isImplicitThis()) return false;
  if (classNode.getDeclaredField(methodName) == null) return false;
  Expression arguments = call.getArguments();
  return ! classNode.hasPossibleMethod(methodName, arguments);
}
origin: org.kohsuke.droovy/groovy

private boolean isClosureCall(MethodCallExpression call) {
  // are we a local variable?
  // it should not be an explicitly "this" qualified method call
  // and the current class should have a possible method
  String methodName = call.getMethodAsString();
  if (methodName==null) return false;
  if (!call.isImplicitThis()) return false;
  if (!isThisExpression(call.getObjectExpression())) return false;
  //if (isNotExplicitThisInClosure(call.isImplicitThis()) return false;
  if (classNode.getDeclaredField(methodName) == null) return false;
  Expression arguments = call.getArguments();
  return ! classNode.hasPossibleMethod(methodName, arguments);
}
origin: org.codehaus.groovy/groovy-jdk14

private boolean isClosureCall(MethodCallExpression call) {
  // are we a local variable?
  // it should not be an explicitly "this" qualified method call
  // and the current class should have a possible method
  String methodName = call.getMethodAsString();
  if (methodName==null) return false;
  if (!call.isImplicitThis()) return false;
  if (!isThisExpression(call.getObjectExpression())) return false;
  FieldNode field = classNode.getDeclaredField(methodName);
  if (field == null) return false;
  if (isStaticInvocation(call) && !field.isStatic()) return false;
  Expression arguments = call.getArguments();
  return ! classNode.hasPossibleMethod(methodName, arguments);
}
origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

private boolean isClosureCall(MethodCallExpression call) {
  // are we a local variable?
  // it should not be an explicitly "this" qualified method call
  // and the current class should have a possible method
  ClassNode classNode = controller.getClassNode();
  String methodName = call.getMethodAsString();
  if (methodName==null) return false;
  if (!call.isImplicitThis()) return false;
  if (!AsmClassGenerator.isThisExpression(call.getObjectExpression())) return false;
  FieldNode field = classNode.getDeclaredField(methodName);
  if (field == null) return false;
  if (isStaticInvocation(call) && !field.isStatic()) return false;
  Expression arguments = call.getArguments();
  return ! classNode.hasPossibleMethod(methodName, arguments);
}
origin: org.codehaus.groovy/groovy-jdk14

boolean lookForPossibleStaticMethod = !methodName.equals("call");
if (currentMethod != null && !currentMethod.isStatic()) {
  if (currentClass.hasPossibleMethod(methodName, args)) {
    lookForPossibleStaticMethod = false;
origin: org.kohsuke.droovy/groovy

boolean lookForPossibleStaticMethod = true;
if(this.currentMethod != null && !this.currentMethod.isStatic()) {
  if(currentClass.hasPossibleMethod(methodName, args)) {
    lookForPossibleStaticMethod = false;
origin: org.codehaus.groovy/groovy-all-minimal

boolean lookForPossibleStaticMethod = true;
if(this.currentMethod != null && !this.currentMethod.isStatic()) {
  if(currentClass.hasPossibleMethod(methodName, args)) {
    lookForPossibleStaticMethod = false;
origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

boolean lookForPossibleStaticMethod = !methodName.equals("call");
if (currentMethod != null && !currentMethod.isStatic()) {
  if (currentClass.hasPossibleMethod(methodName, args)) {
    lookForPossibleStaticMethod = false;
org.codehaus.groovy.astClassNodehasPossibleMethod

Javadoc

Returns true if the given method has a possibly matching instance method with the given name and arguments.

Popular methods of ClassNode

  • getName
  • getMethods
    This methods creates a list of all methods with this name of the current class and of all super clas
  • <init>
    Constructor used by makeArray() if no real class is available
  • getSuperClass
  • equals
  • addMethod
  • getAnnotations
  • addField
  • getFields
    Returns a list containing FieldNode objects for each field in the class represented by this ClassNod
  • getPlainNodeReference
  • getField
    Finds a field matching the given name in this class or a parent class.
  • getMethod
    Finds a method matching the given name and parameters in this class or any parent class.
  • getField,
  • getMethod,
  • isInterface,
  • getNameWithoutPackage,
  • isScript,
  • getDeclaredMethod,
  • getGenericsTypes,
  • getDeclaredConstructors,
  • getModifiers,
  • getTypeClass

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • runOnUiThread (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JPanel (javax.swing)
  • JTable (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now