@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; }
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); }
@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; }
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); }
@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); }
@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; }
@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); }
@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; }
@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; }
public Boolean visitWildcard(WildcardTree node, ConstructorData p) { super.visitWildcard(node, p); return null; }
@Override public List<? extends TypeMirror> visitWildcard(WildcardTree node, Object p) { return null; }
@Override public Mirror visitWildcard(WildcardTree arg0, EvaluationContext evaluationContext) { Assert.error(arg0, "unsupported"); return null; }
@Override public R visitWildcard(WildcardTree wt, P p) { return null; }
@Override public List<T> visitWildcard(WildcardTree node, T p) { return checkForCriteria(node); }
@Override public Object visitWildcard(WildcardTree t, Trees p) { info("WildcardTree" + CL + t.getKind() + SP + t); return super.visitWildcard(t, p); }
@Override public Pair<ASTRecord, Integer> visitWildcard(WildcardTree node, Insertion ins) { JCWildcard wc = (JCWildcard) node; return Pair.of(astRecord(node), wc.getStartPosition()); }
@Override public UWildcard visitWildcard(WildcardTree tree, Void v) { return UWildcard.create( tree.getKind(), (tree.getBound() == null) ? null : templateType(tree.getBound())); }
@Override public Choice<Unifier> visitWildcard(WildcardTree node, Unifier unifier) { return Choice.condition(getKind() == node.getKind(), unifier) .thenChoose(unifications(getBound(), node.getBound())); }
@Override public Node visitWildcard(WildcardTree tree, Void p) { assert false : "WildcardTree is unexpected in AST to CFG translation"; return null; }
@Override public PurityResult visitWildcard(WildcardTree node, PurityResult p) { assert false : "this type of tree is unexpected here"; return null; }
@Override public Void visitWildcard(WildcardTree tree, Void p) { if (locations) System.out.println("wildcard"); return super.visitWildcard(tree, p); }
@Override public JType visitWildcard(WildcardTree wt, Void __) { Tree b = wt.getBound(); if (b==null) return codeModel.wildcard(); else return visit(b).boxify().wildcard(); }
Description matchWildcard(WildcardTree tree, VisitorState state);