本文整理汇总了Java中com.sun.source.tree.WildcardTree类的典型用法代码示例。如果您正苦于以下问题:Java WildcardTree类的具体用法?Java WildcardTree怎么用?Java WildcardTree使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WildcardTree类属于com.sun.source.tree包,在下文中一共展示了WildcardTree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitWildcard
import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@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;
}
示例2: createGetClasses
import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
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);
}
示例3: visitWildcard
import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@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;
}
示例4: visitWildcard
import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
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);
}
示例5: visitWildcard
import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@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);
}
示例6: visitWildcard
import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@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;
}
示例7: visitWildcard
import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@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);
}
示例8: visitWildcard
import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@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;
}
示例9: visitWildcard
import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@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;
}
示例10: visitWildcard
import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
public Boolean visitWildcard(WildcardTree node, ConstructorData p) {
super.visitWildcard(node, p);
return null;
}
示例11: visitWildcard
import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@Override
public List<? extends TypeMirror> visitWildcard(WildcardTree node, Object p) {
return null;
}
示例12: visitWildcard
import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@Override
public Mirror visitWildcard(WildcardTree arg0, EvaluationContext evaluationContext) {
Assert.error(arg0, "unsupported");
return null;
}
示例13: visitWildcard
import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@Override
public R visitWildcard(WildcardTree wt, P p) {
return null;
}
示例14: visitWildcard
import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@Override
public List<T> visitWildcard(WildcardTree node, T p) {
return checkForCriteria(node);
}
示例15: visitWildcard
import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@Override
public Object visitWildcard(WildcardTree t, Trees p) {
info("WildcardTree" + CL + t.getKind() + SP + t);
return super.visitWildcard(t, p);
}