当前位置: 首页>>代码示例>>Java>>正文


Java WildcardTree类代码示例

本文整理汇总了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;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:17,代码来源:JavaInputAstVisitor.java

示例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);
    }
 
开发者ID:jeddict,项目名称:jCode,代码行数:26,代码来源:RestUtils.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:TreeDuplicator.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:CopyFinder.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:SemanticHighlighterBase.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:TreeNode.java

示例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);
}
 
开发者ID:google,项目名称:error-prone,代码行数:15,代码来源:ErrorProneScanner.java

示例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;
}
 
开发者ID:reprogrammer,项目名称:checker-framework,代码行数:16,代码来源:TypeFromTree.java

示例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;
}
 
开发者ID:google,项目名称:compile-testing,代码行数:12,代码来源:TreeDiffer.java

示例10: visitWildcard

import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
public Boolean visitWildcard(WildcardTree node, ConstructorData p) {
    super.visitWildcard(node, p);
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:Flow.java

示例11: visitWildcard

import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@Override
public List<? extends TypeMirror> visitWildcard(WildcardTree node, Object p) {
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:ExpectedTypeResolver.java

示例12: visitWildcard

import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@Override
public Mirror visitWildcard(WildcardTree arg0, EvaluationContext evaluationContext) {
    Assert.error(arg0, "unsupported");
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:EvaluatorVisitor.java

示例13: visitWildcard

import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@Override
public R visitWildcard(WildcardTree wt, P p) {
    return null;
}
 
开发者ID:fundacionjala,项目名称:oblivion-netbeans-plugin,代码行数:5,代码来源:ApexTreeVisitorAdapter.java

示例14: visitWildcard

import com.sun.source.tree.WildcardTree; //导入依赖的package包/类
@Override
public List<T> visitWildcard(WildcardTree node, T p) {
    return checkForCriteria(node);
}
 
开发者ID:fundacionjala,项目名称:oblivion-netbeans-plugin,代码行数:5,代码来源:TreeFinder.java

示例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);
}
 
开发者ID:proyecto-adalid,项目名称:adalid,代码行数:6,代码来源:CodeAnalyzerTreeVisitor.java


注:本文中的com.sun.source.tree.WildcardTree类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。