Java 类com.sun.source.tree.WildcardTree 实例源码

项目:javaide    文件:JavaInputAstVisitor.java   
@Override
public Void visitWildcard(WildcardTree node, Void unused) {
    sync(node);
    builder.open(ZERO);
    token("?");
    if (node.getBound() != null) {
        builder.open(plusFour);
        builder.space();
        token(node.getKind() == EXTENDS_WILDCARD ? "extends" : "super");
        builder.breakOp(" ");
        scan(node.getBound(), null);
        builder.close();
    }
    builder.close();
    return null;
}
项目:jCode    文件:RestUtils.java   
private static ClassTree createGetClasses(WorkingCopy workingCopy, TreeMaker maker, ClassTree newTree, RestSupport restSupport, List<String> providerClasses) {

        ModifiersTree modifiersTree = maker.Modifiers(
                EnumSet.of(Modifier.PUBLIC), Collections.singletonList(
                maker.Annotation(maker.QualIdent(
                        Override.class.getCanonicalName()),
                        Collections.<ExpressionTree>emptyList())));

        WildcardTree wildCard = maker.Wildcard(Tree.Kind.UNBOUNDED_WILDCARD,
                null);
        ParameterizedTypeTree wildClass = maker.ParameterizedType(
                maker.QualIdent(Class.class.getCanonicalName()),
                Collections.singletonList(wildCard));
        ParameterizedTypeTree wildSet = maker.ParameterizedType(
                maker.QualIdent(Set.class.getCanonicalName()),
                Collections.singletonList(wildClass));

        MethodTree methodTree = maker.Method(modifiersTree,
                RestConstants.GET_CLASSES, wildSet,
                Collections.<TypeParameterTree>emptyList(),
                Collections.<VariableTree>emptyList(),
                Collections.<ExpressionTree>emptyList(),
                createBodyForGetClassesMethod(restSupport, providerClasses), null);
        return maker.addClassMember(newTree, methodTree);
    }
项目:incubator-netbeans    文件:TreeDuplicator.java   
@Override
public Tree visitWildcard(WildcardTree tree, Void p) {
    WildcardTree n = make.Wildcard(tree.getKind(), tree.getBound());
    model.setType(n, model.getType(tree));
    comments.copyComments(tree, n);
    model.setPos(n, model.getPos(tree));
    return n;
}
项目:incubator-netbeans    文件:CopyFinder.java   
public Boolean visitWildcard(WildcardTree node, TreePath p) {
    if (p == null)
        return super.visitWildcard(node, p);

    WildcardTree t = (WildcardTree) p.getLeaf();

    return scan(node.getBound(), t.getBound(), p);
}
项目:incubator-netbeans    文件:SemanticHighlighterBase.java   
@Override
public Void visitWildcard(WildcardTree node, EnumSet<UseTypes> p) {
    if (node.getBound() != null && node.getBound().getKind() == Kind.IDENTIFIER) {
        handlePossibleIdentifier(new TreePath(getCurrentPath(), node.getBound()), EnumSet.of(UseTypes.CLASS_USE));
    }
    return super.visitWildcard(node, p);
}
项目:incubator-netbeans    文件:TreeNode.java   
@Override
public Void visitWildcard(WildcardTree tree, List<Node> d) {
    List<Node> below = new ArrayList<Node>();

    addCorrespondingType(below);
    addCorrespondingComments(below);
    super.visitWildcard(tree, below);

    d.add(new TreeNode(info, getCurrentPath(), below));
    return null;
}
项目:error-prone    文件:ErrorProneScanner.java   
@Override
public Void visitWildcard(WildcardTree tree, VisitorState visitorState) {
  VisitorState state = visitorState.withPath(getCurrentPath());
  for (WildcardTreeMatcher matcher : wildcardMatchers) {
    if (!isSuppressed(matcher, state)) {
      try {
        reportMatch(matcher.matchWildcard(tree, state), tree, state);
      } catch (Throwable t) {
        handleError(matcher, t);
      }
    }
  }
  return super.visitWildcard(tree, state);
}
项目:checker-framework    文件:TypeFromTree.java   
@Override
public AnnotatedTypeMirror visitWildcard(WildcardTree node,
        AnnotatedTypeFactory f) {

    AnnotatedTypeMirror bound = visit(node.getBound(), f);

    AnnotatedTypeMirror result = f.type(node);
    assert result instanceof AnnotatedWildcardType;
    if (node.getKind() == Tree.Kind.SUPER_WILDCARD) {
        ((AnnotatedWildcardType)result).setSuperBound(bound);
    } else if (node.getKind() == Tree.Kind.EXTENDS_WILDCARD) {
        ((AnnotatedWildcardType)result).setExtendsBound(bound);
    }
    return result;
}
项目:checker-framework    文件:TypeFromTree.java   
@Override
public AnnotatedTypeMirror visitWildcard(WildcardTree node,
        AnnotatedTypeFactory f) {

    AnnotatedTypeMirror bound = visit(node.getBound(), f);

    AnnotatedTypeMirror result = f.type(node);
    assert result instanceof AnnotatedWildcardType;
    if (node.getKind() == Tree.Kind.SUPER_WILDCARD) {
        ((AnnotatedWildcardType)result).setSuperBound(bound);
    } else if (node.getKind() == Tree.Kind.EXTENDS_WILDCARD) {
        ((AnnotatedWildcardType)result).setExtendsBound(bound);
    }
    return result;
}
项目:compile-testing    文件:TreeDiffer.java   
@Override
public Void visitWildcard(WildcardTree expected, Tree actual) {
  Optional<WildcardTree> other = checkTypeAndCast(expected, actual);
  if (!other.isPresent()) {
    addTypeMismatch(expected, actual);
    return null;
  }

  scan(expected.getBound(), other.get().getBound());
  return null;
}
项目:incubator-netbeans    文件:Flow.java   
public Boolean visitWildcard(WildcardTree node, ConstructorData p) {
    super.visitWildcard(node, p);
    return null;
}
项目:incubator-netbeans    文件:ExpectedTypeResolver.java   
@Override
public List<? extends TypeMirror> visitWildcard(WildcardTree node, Object p) {
    return null;
}
项目:incubator-netbeans    文件:EvaluatorVisitor.java   
@Override
public Mirror visitWildcard(WildcardTree arg0, EvaluationContext evaluationContext) {
    Assert.error(arg0, "unsupported");
    return null;
}
项目:oblivion-netbeans-plugin    文件:ApexTreeVisitorAdapter.java   
@Override
public R visitWildcard(WildcardTree wt, P p) {
    return null;
}
项目:oblivion-netbeans-plugin    文件:TreeFinder.java   
@Override
public List<T> visitWildcard(WildcardTree node, T p) {
    return checkForCriteria(node);
}
项目:adalid    文件:CodeAnalyzerTreeVisitor.java   
@Override
public Object visitWildcard(WildcardTree t, Trees p) {
    info("WildcardTree" + CL + t.getKind() + SP + t);
    return super.visitWildcard(t, p);
}
项目:annotation-tools    文件:TreeFinder.java   
@Override
public Pair<ASTRecord, Integer> visitWildcard(WildcardTree node, Insertion ins) {
  JCWildcard wc = (JCWildcard) node;
  return Pair.of(astRecord(node), wc.getStartPosition());
}
项目:error-prone    文件:UTemplater.java   
@Override
public UWildcard visitWildcard(WildcardTree tree, Void v) {
  return UWildcard.create(
      tree.getKind(), (tree.getBound() == null) ? null : templateType(tree.getBound()));
}
项目:error-prone    文件:UWildcard.java   
@Override
public Choice<Unifier> visitWildcard(WildcardTree node, Unifier unifier) {
  return Choice.condition(getKind() == node.getKind(), unifier)
      .thenChoose(unifications(getBound(), node.getBound()));
}
项目:checker-framework    文件:CFGBuilder.java   
@Override
public Node visitWildcard(WildcardTree tree, Void p) {
    assert false : "WildcardTree is unexpected in AST to CFG translation";
    return null;
}
项目:checker-framework    文件:PurityChecker.java   
@Override
public PurityResult visitWildcard(WildcardTree node, PurityResult p) {
    assert false : "this type of tree is unexpected here";
    return null;
}
项目:checker-framework    文件:Locations.java   
@Override
public Void visitWildcard(WildcardTree tree, Void p) {
    if (locations)
        System.out.println("wildcard");
    return super.visitWildcard(tree, p);
}
项目:groovy-cps    文件:Translator.java   
@Override
public JType visitWildcard(WildcardTree wt, Void __) {
    Tree b = wt.getBound();
    if (b==null)    return codeModel.wildcard();
    else            return visit(b).boxify().wildcard();
}
项目:bazel    文件:CFGBuilder.java   
@Override
public Node visitWildcard(WildcardTree tree, Void p) {
    assert false : "WildcardTree is unexpected in AST to CFG translation";
    return null;
}
项目:error-prone    文件:BugChecker.java   
Description matchWildcard(WildcardTree tree, VisitorState state);