Java 类org.eclipse.jdt.core.dom.AnnotatableType 实例源码

项目:eclipse.jdt.ls    文件:ASTNodeFactory.java   
/**
 * Create a Type suitable as the creationType in a ClassInstanceCreation expression.
 * @param ast The AST to create the nodes for.
 * @param typeBinding binding representing the given class type
 * @param importRewrite the import rewrite to use
 * @param importContext the import context used to determine which (null) annotations to consider
 * @return a Type suitable as the creationType in a ClassInstanceCreation expression.
 */
public static Type newCreationType(AST ast, ITypeBinding typeBinding, ImportRewrite importRewrite, ImportRewriteContext importContext) {
    if (typeBinding.isParameterizedType()) {
        Type baseType= newCreationType(ast, typeBinding.getTypeDeclaration(), importRewrite, importContext);
        IAnnotationBinding[] typeAnnotations= importContext.removeRedundantTypeAnnotations(typeBinding.getTypeAnnotations(), TypeLocation.NEW, typeBinding);
        for (IAnnotationBinding typeAnnotation : typeAnnotations) {
            ((AnnotatableType)baseType).annotations().add(importRewrite.addAnnotation(typeAnnotation, ast, importContext));
        }
        ParameterizedType parameterizedType= ast.newParameterizedType(baseType);
        for (ITypeBinding typeArgument : typeBinding.getTypeArguments()) {
            typeArgument= StubUtility2.replaceWildcardsAndCaptures(typeArgument);
            parameterizedType.typeArguments().add(importRewrite.addImport(typeArgument, ast, importContext, TypeLocation.TYPE_ARGUMENT));
        }
        return parameterizedType;
    } else {
        return importRewrite.addImport(typeBinding, ast, importContext, TypeLocation.NEW);
    }
}
项目:eclipse.jdt.ls    文件:ImportReferencesCollector.java   
private void visitAnnotations(AnnotatableType node) {
    if (node.getAST().apiLevel() >= AST.JLS8) {
        doVisitChildren(node.annotations());
    }
}
项目:che    文件:ImportReferencesCollector.java   
private void visitAnnotations(AnnotatableType node) {
  if (node.getAST().apiLevel() >= AST.JLS8) {
    doVisitChildren(node.annotations());
  }
}
项目:Eclipse-Postfix-Code-Completion    文件:ImportReferencesCollector.java   
private void visitAnnotations(AnnotatableType node) {
    if (node.getAST().apiLevel() >= AST.JLS8) {
        doVisitChildren(node.annotations());
    }
}