Package lombok.ast

Examples of lombok.ast.MethodInvocation


      exec.rawExpression(expr);
      set(node, exec);
    }
   
    @Override public void visitApply(JCMethodInvocation node) {
      MethodInvocation inv = new MethodInvocation();
      JCTree sel = node.getMethodSelect();
      Identifier id = new Identifier();
      if (sel instanceof JCIdent) {
        String name = ((JCIdent) sel).getName().toString();
        if ("this".equals(name)) {
          AlternateConstructorInvocation aci = new AlternateConstructorInvocation();
          fillList(node.getTypeArguments(), aci.rawConstructorTypeArguments(), FlagKey.TYPE_REFERENCE);
          fillList(node.getArguments(), aci.rawArguments());
          set(node, aci);
          setConversionPositionInfo(aci, "this", getPosition(sel));
          return;
        }
       
        if ("super".equals(name)) {
          SuperConstructorInvocation sci = new SuperConstructorInvocation();
          fillList(node.getTypeArguments(), sci.rawConstructorTypeArguments(), FlagKey.TYPE_REFERENCE);
          fillList(node.getArguments(), sci.rawArguments());
          set(node, sci);
          setConversionPositionInfo(sci, "super", getPosition(sel));
          return;
        }
       
        setPos(sel, id.astValue(name));
        sel = null;
      } else if (sel instanceof JCFieldAccess) {
        String name = ((JCFieldAccess) sel).getIdentifier().toString();
        if ("super".equals(name)) {
          SuperConstructorInvocation sci = new SuperConstructorInvocation();
          fillList(node.getTypeArguments(), sci.rawConstructorTypeArguments(), FlagKey.TYPE_REFERENCE);
          fillList(node.getArguments(), sci.rawArguments());
          sci.rawQualifier(toTree(((JCFieldAccess) sel).getExpression()));
          set(node, sci);
          setConversionPositionInfo(sci, "super", getPosition(sel));
          return;
        }
        setPos(sel, id.astValue(name));
        sel = ((JCFieldAccess) sel).getExpression();
      }
      inv.astName(id).rawOperand(toTree(sel));
      fillList(node.getTypeArguments(), inv.rawMethodTypeArguments(), FlagKey.TYPE_REFERENCE);
      fillList(node.getArguments(), inv.rawArguments());
      set(node, inv);
    }
View Full Code Here


        public Expression getArgument(int argument) {
            if (!(mTargetNode instanceof MethodInvocation)) {
                return null;
            }
            MethodInvocation call = (MethodInvocation) mTargetNode;
            StrictListAccessor<Expression, MethodInvocation> args = call.astArguments();
            if (argument >= args.size()) {
                return null;
            }

            Iterator<Expression> iterator = args.iterator();
View Full Code Here

            if (expression instanceof VariableReference) {
                VariableReference reference = (VariableReference) expression;
                String variable = reference.astIdentifier().astValue();
                return mTypes.get(variable);
            } else if (expression instanceof MethodInvocation) {
                MethodInvocation method = (MethodInvocation) expression;
                String methodName = method.astName().astValue();
                if (methodName.equals(GET_STRING_METHOD)) {
                    return String.class;
                }
            } else if (expression instanceof StringLiteral) {
                return String.class;
View Full Code Here

   
    return current;
  }
 
  public Node createMethodInvocationOperation(org.parboiled.Node<Node> dot, Node typeArguments, Node name, Node arguments) {
    MethodInvocation mi = new MethodInvocation().astName(createIdentifierIfNeeded(name, currentPos()));
   
    if (typeArguments instanceof TemporaryNode.TypeArguments) {
      for (Node arg : ((TemporaryNode.TypeArguments)typeArguments).arguments) {
        mi.rawMethodTypeArguments().addToEnd(arg);
      }
    } else DanglingNodes.addDanglingNode(mi, typeArguments);
   
    if (arguments instanceof TemporaryNode.MethodArguments) {
      for (Node arg : ((TemporaryNode.MethodArguments)arguments).arguments) {
        mi.rawArguments().addToEnd(arg);
      }
    } else DanglingNodes.addDanglingNode(mi, arguments);
   
    source.registerStructure(mi, dot);
   
View Full Code Here

 
  public Node createPrimary(Node identifier, Node methodArguments) {
    Identifier id = createIdentifierIfNeeded(identifier, currentPos());
   
    if (methodArguments instanceof TemporaryNode.MethodArguments) {
      MethodInvocation invoke = new MethodInvocation().astName(id);
      for (Node arg : ((TemporaryNode.MethodArguments)methodArguments).arguments) {
        invoke.rawArguments().addToEnd(arg);
      }
      return posify(invoke);
    } else {
      VariableReference ref = new VariableReference().astIdentifier(id);
      DanglingNodes.addDanglingNode(ref, methodArguments);
View Full Code Here

TOP

Related Classes of lombok.ast.MethodInvocation

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.