Package lombok.ast

Examples of lombok.ast.TypeReference


        }

        Iterator<Annotation> iterator = annotations.iterator();
        while (iterator.hasNext()) {
            Annotation annotation = iterator.next();
            TypeReference t = annotation.astAnnotationTypeReference();
            String typeName = t.getTypeName();
            if (typeName.endsWith(SUPPRESS_LINT)
                    || typeName.endsWith("SuppressWarnings")) {     //$NON-NLS-1$
                StrictListAccessor<AnnotationElement, Annotation> values =
                        annotation.astElements();
                if (values != null) {
View Full Code Here


        }

        Iterator<Annotation> iterator = annotations.iterator();
        while (iterator.hasNext()) {
            Annotation annotation = iterator.next();
            TypeReference t = annotation.astAnnotationTypeReference();
            String typeName = t.getTypeName();
            if (typeName.endsWith(SUPPRESS_LINT)
                    || typeName.endsWith("SuppressWarnings")) {     //$NON-NLS-1$
                StrictListAccessor<AnnotationElement, Annotation> values =
                        annotation.astElements();
                if (values != null) {
View Full Code Here

 
  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

    if (extendsOrSuper != null) extendsOrSuper = extendsOrSuper.trim();
    WildcardKind wildcard = WildcardKind.UNBOUND;
    if ("extends".equalsIgnoreCase(extendsOrSuper)) wildcard = WildcardKind.EXTENDS;
    if ("super".equalsIgnoreCase(extendsOrSuper)) wildcard = WildcardKind.SUPER;
   
    TypeReference ref;
   
    if (!(type instanceof TypeReference)) {
      ref = new TypeReference();
      DanglingNodes.addDanglingNode(ref, type);
    } else {
      ref = (TypeReference)type;
    }
   
    ref.astWildcard(wildcard);
    source.registerStructure(ref, qmark);
    for (org.parboiled.Node<Node> childPNode : boundType.getChildren()) {
      if (childPNode != null) source.registerStructure(ref, childPNode);
    }
    return posify(ref);
View Full Code Here

    }
    return posify(ref);
  }
 
  public Node createUnboundedWildcardType(org.parboiled.Node<Node> qmark) {
    TypeReference ref = new TypeReference().astWildcard(WildcardKind.UNBOUND);
    source.registerStructure(ref, qmark);
    return posify(ref);
  }
View Full Code Here

   
    return posify(ta);
  }
 
  public Node createReferenceType(Node head, List<Node> tail) {
    TypeReference t = new TypeReference();
    if (head != null) t.rawParts().addToEnd(head);
    if (tail != null) for (Node n : tail) {
      if (n != null) t.rawParts().addToEnd(n);
    }
   
    return posify(t);
  }
View Full Code Here

  public Node setArrayDimensionsOfType(Node value, List<String> bracketPairs) {
    //TODO test a public int foo() [] {} method declaration.
    int arrayDims = bracketPairs == null ? 0 : bracketPairs.size();
    if (arrayDims == 0) return value;
   
    TypeReference ref = new TypeReference().astArrayDimensions(arrayDims);
    if (value instanceof TypeReference) {
      TypeReference orig = (TypeReference)value;
      ref.astWildcard(orig.astWildcard());
      ref.rawParts().migrateAllFrom(orig.rawParts());
    }
    return posify(ref);
  }
View Full Code Here

     
      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

TOP

Related Classes of lombok.ast.TypeReference

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.