Examples of arguments()


Examples of org.eclipse.jdt.core.dom.ClassInstanceCreation.arguments()

  private Icon parseIcon(Icon oldValue, Expression arg) {
    if (oldValue != null && !(oldValue instanceof ResourceIcon)) {
      Icon icon = (Icon) oldValue;
      if (arg instanceof ClassInstanceCreation) {
        ClassInstanceCreation instanceCreation = (ClassInstanceCreation) arg;
        List args = instanceCreation.arguments();
        arg = (Expression) args.get(0);
        if (arg instanceof MethodInvocation) {
          MethodInvocation mi = (MethodInvocation) arg;
          args = mi.arguments();
          arg = (Expression) args.get(0);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ClassInstanceCreation.arguments()

        } else {
          Type typeName = cic.getType();
          if (typeName instanceof SimpleType) {
            SimpleType simpleType = (SimpleType) typeName;
            className = simpleType.getName().getFullyQualifiedName();
            List args = cic.arguments();
            if (args != null && args.size() > 0) {
              StringBuilder builder = new StringBuilder();
              for (int i = 0; i < args.size(); i++) {
                Object para = args.get(i);
                if (i != 0)
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ClassInstanceCreation.arguments()

    if (oldValue != null && !(oldValue instanceof ResourceIcon)) {
      Icon icon = (Icon) oldValue;
      Expression arg = (Expression) args.get(0);
      if (arg instanceof ClassInstanceCreation) {
        ClassInstanceCreation instanceCreation = (ClassInstanceCreation) arg;
        args = instanceCreation.arguments();
        arg = (Expression) args.get(0);
        if (arg instanceof MethodInvocation) {
          MethodInvocation mi = (MethodInvocation) arg;
          args = mi.arguments();
          arg = (Expression) args.get(0);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ConstructorInvocation.arguments()

    }

    case ASTNode.CONSTRUCTOR_INVOCATION: {
      final ConstructorInvocation ctorCall = (ConstructorInvocation) node;
      // if coming up from a argument.
      if (containedIn(ctorCall.arguments(), this.name))
        // if we don't have the source, no can do.
        if (!ctorCall.resolveConstructorBinding().getDeclaringClass()
            .isFromSource())
          throw new DefinitelyNotEnumerizableException(
              Messages.ASTNodeProcessor_SourceNotPresent, node);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.EnumConstantDeclaration.arguments()

        if (m_class instanceof EnumDeclaration) {
            EnumConstantDeclaration enumdecl = getAST().newEnumConstantDeclaration();
            enumdecl.setName(getAST().newSimpleName(name));
            StringLiteral strlit = getAST().newStringLiteral();
            strlit.setLiteralValue(value);
            enumdecl.arguments().add(strlit);
            addJavaDoc(doc, enumdecl);
            ((EnumDeclaration)m_class).enumConstants().add(enumdecl);
        } else {
            // should not be possible, but just in case of added types in future
            throw new IllegalStateException("Internal error - cannot add constant to class type");
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodInvocation.arguments()

    MethodInvocation node = runScript.getProperty(MethodInvocation.class, "node");
   
    assertThat(node, is(notNullValue()));
    assertThat(node.getExpression().toString(), is("person"));
    assertThat(node.getName().toString(), is("setName"));
    assertThat((List<ASTNode>) node.arguments(),
           Matchers.<ASTNode>hasItems(a_node().with_text_representation("\"Bob\"")));
  }
 
  public static final class ASTNodeMatcher extends TypeSafeDiagnosingMatcher<ASTNode> {
    public static final ASTNodeMatcher a_node() {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodInvocation.arguments()

        ClassInstanceCreation instanceCreation = (ClassInstanceCreation) arg;
        List args = instanceCreation.arguments();
        arg = (Expression) args.get(0);
        if (arg instanceof MethodInvocation) {
          MethodInvocation mi = (MethodInvocation) arg;
          args = mi.arguments();
          arg = (Expression) args.get(0);
          if (arg instanceof StringLiteral) {
            StringLiteral sl = (StringLiteral) arg;
            String path = sl.getLiteralValue();
            return new ResourceIcon(icon, path);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodInvocation.arguments()

        Expression expression = es.getExpression();
        if (expression instanceof MethodInvocation) {
          MethodInvocation mi = (MethodInvocation) expression;
          Expression optional = mi.getExpression();
          if (optional == null||optional instanceof ThisExpression) {
            List list = mi.arguments();
            if (list.size() != 1) {
              return new CodeSnippet(adapter, eventSet, methodDesc, es.toString());
            }
            Expression exp = (Expression) list.get(0);
            if (exp instanceof SimpleName) {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodInvocation.arguments()

    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof MethodCallInstruction);
    MethodCallInstruction call = (MethodCallInstruction) instr;
   
    List<Variable> args = call.getArgOperands();
    EclipseTACSimpleTestDriver.assertOperands(inv.arguments(), args, tac);
    Assert.assertEquals(1, args.size());
   
    Assignment write = (Assignment) inv.arguments().get(0);
    instr = tac.instruction(write);
    Assert.assertTrue(instr != null);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodInvocation.arguments()

   
    List<Variable> args = call.getArgOperands();
    EclipseTACSimpleTestDriver.assertOperands(inv.arguments(), args, tac);
    Assert.assertEquals(1, args.size());
   
    Assignment write = (Assignment) inv.arguments().get(0);
    instr = tac.instruction(write);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof StoreFieldInstruction);
    StoreFieldInstruction store = (StoreFieldInstruction) instr;
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.