Package org.eclipse.php.internal.core.ast.nodes

Examples of org.eclipse.php.internal.core.ast.nodes.IMethodBinding


    private IMethod overriddenMethod;

    @Override
    public boolean visit(org.eclipse.php.internal.core.ast.nodes.MethodDeclaration node) {
      if (node.getFunction().getFunctionName().getName().equals(method.getElementName())) {
        IMethodBinding methodBinding = node.resolveMethodBinding();
        if (methodBinding != null) {
          IMethodBinding overriddenMethodBinding = Bindings.findOverriddenMethod(methodBinding, true);
          if (overriddenMethodBinding != null) {
            overriddenMethod = (IMethod) overriddenMethodBinding.getPHPElement();
          }
        }

        return false;
      }
View Full Code Here


        .statements().get(0);
    Assignment assignment = (Assignment) statement.getExpression();
    ClassInstanceCreation instanceCreation = (ClassInstanceCreation) assignment
        .getRightHandSide();

    IMethodBinding constructorBinding = instanceCreation
        .resolveConstructorBinding();

    Assert.assertNotNull(constructorBinding);
    Assert.assertTrue(constructorBinding.isConstructor() == true);
    Assert.assertTrue(constructorBinding.getName().equals("MyClass"));
    Assert.assertTrue(constructorBinding.getKind() == IBinding.METHOD);
  }
View Full Code Here

    ExpressionStatement statement = (ExpressionStatement) program
        .statements().get(2);
    MethodInvocation methodInvocation = (MethodInvocation) statement
        .getExpression();
    IMethodBinding methodBinding = methodInvocation.resolveMethodBinding();

    Assert.assertNotNull(methodBinding);
    Assert.assertTrue(methodBinding.getName().equals("mymethod"));
    Assert.assertNotNull(methodBinding.getDeclaringClass());
    Assert.assertTrue(methodBinding.getDeclaringClass().getName()
        .equals("MyClass"));
    Assert.assertTrue(methodBinding.isConstructor() == false);
    Assert.assertTrue(methodBinding.getReturnType()[0].getName().equals(
        "string"));
  }
View Full Code Here

    ClassDeclaration classDeclaration = (ClassDeclaration) program
        .statements().get(0);
    MethodDeclaration methodDeclaration = (MethodDeclaration) classDeclaration
        .getBody().statements().get(0);

    IMethodBinding methodBinding = methodDeclaration.resolveMethodBinding();
    Assert.assertNotNull(methodBinding);
    Assert.assertTrue(methodBinding.getName().equals("foo"));
    Assert.assertNotNull(methodBinding.getDeclaringClass());
    Assert.assertTrue(methodBinding.getDeclaringClass().getName()
        .equals("MyClass"));
    Assert.assertTrue(methodBinding.isConstructor() == false);
    Assert.assertTrue(methodBinding.getReturnType()[0].getName().equals(
        "MyClass"));

  }
View Full Code Here

    ClassDeclaration classDeclaration = (ClassDeclaration) program
        .statements().get(0);
    MethodDeclaration methodDeclaration = (MethodDeclaration) classDeclaration
        .getBody().statements().get(0);

    IMethodBinding methodBinding = methodDeclaration.resolveMethodBinding();
    Assert.assertNotNull(methodBinding);
    Assert.assertTrue(methodBinding.getName().equals("foo"));
    Assert.assertNotNull(methodBinding.getDeclaringClass());
    Assert.assertTrue(methodBinding.getDeclaringClass().getName()
        .equals("MyClass"));
    Assert.assertTrue(methodBinding.isConstructor() == false);
    Assert.assertTrue(methodBinding.getReturnType()[0].getName().equals(
        "Generator"));

  }
View Full Code Here

    ExpressionStatement statement = (ExpressionStatement) program
        .statements().get(2);
    MethodInvocation methodInvocation = (MethodInvocation) statement
        .getExpression();

    IMethodBinding methodBinding = methodInvocation.resolveMethodBinding();
    Assert.assertNotNull(methodBinding);
    Assert.assertTrue(methodBinding.getName().equals("foo"));

    ITypeBinding declaringClass = methodBinding.getDeclaringClass();
    Assert.assertNotNull(declaringClass);
    Assert.assertTrue(declaringClass.getName().equals("MyClass"));

    Assert.assertTrue(methodBinding.isConstructor() == false);
  }
View Full Code Here

    ExpressionStatement statement = (ExpressionStatement) program
        .statements().get(1);
    StaticMethodInvocation staticMethodInvocation = (StaticMethodInvocation) statement
        .getExpression();

    IMethodBinding methodBinding = staticMethodInvocation
        .resolveMethodBinding();

    Assert.assertNotNull(methodBinding);
    Assert.assertTrue(methodBinding.isConstructor() == false);
    Assert.assertTrue(methodBinding.getName().equals("foo"));

    ITypeBinding declaringClass = methodBinding.getDeclaringClass();
    Assert.assertNotNull(declaringClass);
    Assert.assertTrue(declaringClass.getName().equals("MyClass"));
    Assert.assertTrue(methodBinding.getKind() == IBinding.METHOD);
  }
View Full Code Here

          //FIXME :res.add(new BindingProperty(this, "IS SYNTHETIC", fBinding.isSynthetic(), isNonPrimitive)); //$NON-NLS-1$
          //FIXME :res.add(new BindingProperty(this, "IS DEPRECATED", fBinding.isDeprecated(), isRefType)); //$NON-NLS-1$
          break;
         
        case IBinding.METHOD:
          IMethodBinding methodBinding= (IMethodBinding) fBinding;
          res.add(new BindingProperty(this, "IS CONSTRUCTOR", methodBinding.isConstructor(), true)); //$NON-NLS-1$
          //FIXME :res.add(new BindingProperty(this, "IS DEFAULT CONSTRUCTOR", methodBinding.isDefaultConstructor(), true)); //$NON-NLS-1$
          res.add(new Binding(this, "DECLARING CLASS", methodBinding.getDeclaringClass(), true)); //$NON-NLS-1$
          //FIXME :res.add(new Binding(this, "RETURN TYPE", methodBinding.getReturnType(), true)); //$NON-NLS-1$
          //FIXME :res.add(new BindingProperty(this, "MODIFIERS", Flags.toString(fBinding.getModifiers()), true)); //$NON-NLS-1$
          //FIXME :res.add(new BindingProperty(this, "PARAMETER TYPES", methodBinding.getParameterTypes(), true)); //$NON-NLS-1$
          res.add(new BindingProperty(this, "IS VARARGS", methodBinding.isVarargs(), true)); //$NON-NLS-1$
          res.add(new BindingProperty(this, "EXCEPTION TYPES", methodBinding.getExceptionTypes(), true)); //$NON-NLS-1$
         
          //StringBuffer genericsM= new StringBuffer("GENERICS:"); //$NON-NLS-1$
          //FIXME :if (methodBinding.isRawMethod()) genericsM.append(" isRawMethod"); //$NON-NLS-1$
          //FIXME :if (methodBinding.isGenericMethod()) genericsM.append(" isGenericMethod"); //$NON-NLS-1$
          //FIXME :if (methodBinding.isParameterizedMethod()) genericsM.append(" isParameterizedMethod"); //$NON-NLS-1$
View Full Code Here

        case IBinding.TYPE:
          ITypeBinding typeBinding= (ITypeBinding) fBinding;
          buf.append(typeBinding.getName());// .getQualifiedName());
          break;
        case IBinding.METHOD:
          IMethodBinding methodBinding= (IMethodBinding) fBinding;
          buf.append(methodBinding.getDeclaringClass().getName());
          buf.append('.');
          buf.append(methodBinding.getName());
          buf.append('(');
          /*//FIXME String[] parameters = methodBinding.getParametersNames();
          for(int i=0 ; i<parameters.length ; i++ ){
            buf.append(parameters[i]+", ");
          }*/
 
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.ast.nodes.IMethodBinding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.