Package lombok.ast

Examples of lombok.ast.TypeReferencePart


    super(source);
  }
 
  public Node createPrimitiveType(String text) {
    Identifier identifier = posify(new Identifier().astValue(text));
    TypeReferencePart typeReferencePart = posify(new TypeReferencePart()
        .astIdentifier(identifier));
    return posify(new TypeReference().rawParts().addToStart(typeReferencePart));
  }
View Full Code Here


        .astIdentifier(identifier));
    return posify(new TypeReference().rawParts().addToStart(typeReferencePart));
  }
 
  public Node createTypeReferencePart(org.parboiled.Node<Node> identifier, Node typeArguments) {
    TypeReferencePart result = new TypeReferencePart().astIdentifier(createIdentifierIfNeeded(identifier.getValue(), currentPos()));
   
    if (typeArguments instanceof TemporaryNode.TypeArguments) {
      for (Node arg : ((TemporaryNode.TypeArguments)typeArguments).arguments) {
        result.rawTypeArguments().addToEnd(arg);
      }
    }
   
    posify(result); //We only care about the end position here.
    return result.setPosition(new Position(identifier.getStartIndex(), result.getPosition().getEnd()));
  }
View Full Code Here

    @Override public void visitTypeIdent(JCPrimitiveTypeTree node) {
      String primitiveType = JcTreeBuilder.PRIMITIVES.inverse().get(node.typetag);
     
      if (primitiveType == null) throw new IllegalArgumentException("Uknown primitive type tag: " + node.typetag);
     
      TypeReferencePart part = setPos(node, new TypeReferencePart().astIdentifier(setPos(node, new Identifier().astValue(primitiveType))));
     
      set(node, new TypeReference().astParts().addToEnd(part));
    }
View Full Code Here

      }
     
      Identifier id = setPos(node, new Identifier().astValue(name));
     
      if (hasFlag(FlagKey.TYPE_REFERENCE)) {
        TypeReferencePart part = setPos(node, new TypeReferencePart().astIdentifier(id));
        set(node, new TypeReference().astParts().addToEnd(part));
        return;
      }
     
      set(node, new VariableReference().astIdentifier(id));
View Full Code Here

      Identifier id = setPos(node, new Identifier().astValue(name));
      Node selected = toTree(node.selected, params);
     
      if (hasFlag(FlagKey.TYPE_REFERENCE)) {
        TypeReference parent = (TypeReference) selected;
        parent.astParts().addToEnd(setPos(node, new TypeReferencePart().astIdentifier(id)));
        set(node, parent);
        return;
      }
     
      if ("this".equals(name)) {
View Full Code Here

      set(node, new Select().astIdentifier(id).rawOperand(toTree(node.getExpression())));
    }
   
    @Override public void visitTypeApply(JCTypeApply node) {
      TypeReference ref = (TypeReference) toTree(node.clazz, FlagKey.TYPE_REFERENCE);
      TypeReferencePart last = ref.astParts().last();
      fillList(node.arguments, last.rawTypeArguments(), FlagKey.TYPE_REFERENCE);
      setPos(node, ref);
      setConversionPositionInfo(last, "<", getPosition(node));
      set(node, ref);
    }
View Full Code Here

  public Node createQualifiedConstructorInvocation(
      Node constructorTypeArgs,
      org.parboiled.Node<Node> identifier, org.parboiled.Node<Node> classTypeArgs,
      Node methodArguments, Node classBody) {
   
    TypeReferencePart classTypeArgs0;
    boolean classTypeArgsCorrect = false;
    Node identifierNode = identifier == null ? null : identifier.getValue();
    if (classTypeArgs != null && classTypeArgs.getValue() instanceof TypeReferencePart) {
      classTypeArgs0 = (TypeReferencePart)classTypeArgs.getValue();
      classTypeArgsCorrect = true;
    } else {
      classTypeArgs0 = new TypeReferencePart();
      if (identifierNode != null) {
        classTypeArgs0.setPosition(identifierNode.getPosition());
      }
    }
   
    TypeReference typeReference = new TypeReference().astParts().addToEnd(
        classTypeArgs0.astIdentifier(createIdentifierIfNeeded(identifierNode, currentPos())));
    if (!classTypeArgsCorrect) {
      if (identifier != null && identifier.getValue() != null) {
        typeReference.setPosition(identifier.getValue().getPosition());
      }
    } else {
View Full Code Here

TOP

Related Classes of lombok.ast.TypeReferencePart

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.