Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.ClassInstanceCreation


        constructor = c;
        break;
      }
    }
   
    ClassInstanceCreation invocationNode = QuickfixUtils.getMockConstructorInvocation(ACCOUNT_CLASS_NAME, new String[0]);
    IMethodBinding methodBinding = QuickfixUtils.getMethodBinding(javaProject, constructor);
    Object[] changeDesc = QuickfixReflectionUtils.createChangeDescriptionArray(1);
   
    changeDesc[0] = QuickfixReflectionUtils.createInsertDescription(targetTypeBinding, "obj");
    return QuickfixReflectionUtils.createChangeMethodSignatureProposal("", targetCU, invocationNode, methodBinding, changeDesc, 5, null);
View Full Code Here


   
    return QuickfixReflectionUtils.createNewFieldProposal("", targetCU, simpleName, targetTypeBinding, 5, null);
  }

  private Object createNewMethodProposal() {
    ClassInstanceCreation invocationNode = QuickfixUtils.getMockConstructorInvocation(ACCOUNT_CLASS_NAME, new String[0]);
    List<Expression> arguments = new ArrayList<Expression>();
    return QuickfixReflectionUtils.createNewMethodProposal("", targetCU, invocationNode, arguments, targetTypeBinding, 5, null);
  }
View Full Code Here

*/
@SuppressWarnings("restriction")
public class ReflectionTests extends TestCase {

  private void testCorrectConstructorInvocation(String className, String[] argTypes) {
    ClassInstanceCreation invocation = QuickfixUtils.getMockConstructorInvocation(className, argTypes);

    Type type = invocation.getType();
    assertTrue("Expects invocation type to be a SimpleType", type instanceof SimpleType);

    SimpleType simpleType = (SimpleType) type;
    assertEquals("Expects invocation class name = " + className, className, simpleType.getName()
        .getFullyQualifiedName());

    assertEquals("Expects number of arguments = " + argTypes.length, argTypes.length, invocation.arguments().size());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.ClassInstanceCreation

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.