private Type annotateType(ITypeBinding binding, AST ast, ImportRewriteContext context, Type type, TypeLocation location) { IAnnotationBinding [] annotationBindings = binding.getTypeAnnotations(); if (annotationBindings != null && annotationBindings.length > 0 && type instanceof AnnotatableType) { annotateList(((AnnotatableType) type).annotations(), annotationBindings, ast, context, location, binding); } return type; }
private Type annotateType(ITypeBinding binding, AST ast, ImportRewriteContext context, Type type) { IAnnotationBinding [] annotationBindings = binding.getTypeAnnotations(); if (annotationBindings != null && annotationBindings.length > 0 && type instanceof AnnotatableType) { annotateList(((AnnotatableType) type).annotations(), annotationBindings, ast, context); } return type; }
private Type annotateType(ITypeBinding binding, AST ast, ImportRewriteContext context, Type type) { IAnnotationBinding [] annotationBindings = binding.getTypeAnnotations(); if (annotationBindings != null && annotationBindings.length > 0 && type instanceof AnnotatableType) { annotateList(((AnnotatableType) type).annotations(), annotationBindings, ast, context); } return type; }
private Type annotateType(ITypeBinding binding, AST ast, ImportRewriteContext context, Type type, TypeLocation location) { IAnnotationBinding [] annotationBindings = binding.getTypeAnnotations(); if (annotationBindings != null && annotationBindings.length > 0 && type instanceof AnnotatableType) { annotateList(((AnnotatableType) type).annotations(), annotationBindings, ast, context, location, binding); } return type; }
private Type annotateType(ITypeBinding binding, AST ast, ImportRewriteContext context, Type type) { IAnnotationBinding [] annotationBindings = binding.getTypeAnnotations(); if (annotationBindings != null && annotationBindings.length > 0 && type instanceof AnnotatableType) { annotateList(((AnnotatableType) type).annotations(), annotationBindings, ast, context); } return type; }
private void visitTypeAnnotations(AnnotatableType node) { if (node.getAST().apiLevel() >= JLS8) { visitAnnotationsList(node.annotations()); } }
private void visitTypeAnnotations(AnnotatableType node) { if (node.getAST().apiLevel() >= AST.JLS8) { visitAnnotationsList(node.annotations()); } }
private void visitAnnotations(AnnotatableType node) { if (node.getAST().apiLevel() >= AST.JLS8) { doVisitChildren(node.annotations()); } }
void printTypeAnnotations(AnnotatableType node) { if (node.getAST().apiLevel() >= JLS8) { printAnnotationsList(node.annotations()); } }
private void visitTypeAnnotations(AnnotatableType node) { if (node.getAST().apiLevel() >= AST.JLS8) { visitAnnotationsList(node.annotations()); } }
private void visitTypeAnnotations(AnnotatableType node) { if (node.getAST().apiLevel() >= JLS8) { visitAnnotationsList(node.annotations()); } }
private void visitTypeAnnotations(AnnotatableType node) { if (node.getAST().apiLevel() >= AST.JLS8) { visitAnnotationsList(node.annotations()); } }
void printTypeAnnotations(AnnotatableType node) { if (node.getAST().apiLevel() >= AST.JLS8) { printAnnotationsList(node.annotations()); } }
private void visitAnnotations(AnnotatableType node) { if (node.getAST().apiLevel() >= AST.JLS8) { doVisitChildren(node.annotations()); } }
private static String typeName(Type type) { if (type instanceof SimpleType) { return ((SimpleType) type).getName().toString().trim(); } if (type instanceof ArrayType) { return typeName(((ArrayType) type).getElementType()); } if (type instanceof ParameterizedType) { return typeName(((ParameterizedType) type).getType()); } if (type instanceof AnnotatableType) { AnnotatableType noAnnoType = (AnnotatableType) ASTNode.copySubtree(type.getAST(), type); noAnnoType.annotations().clear(); return noAnnoType.toString().trim(); } return type.toString().trim(); }
private Type createBaseType(AST ast, ImportRewriteContext context, ITypeBinding normalizedBinding, TypeLocation location) { Type type; IAnnotationBinding annotationBinding [] = normalizedBinding.getTypeAnnotations(); boolean annotsPresent = annotationBinding != null && annotationBinding.length > 0; String qualifiedName= getRawQualifiedName(normalizedBinding); String res = qualifiedName.length() > 0 ? internalAddImport(qualifiedName, context) : getRawName(normalizedBinding); if (annotsPresent) { int dotIndex = res != null ? res.lastIndexOf('.') : -1; if (dotIndex > 0) { Name nameQualifier = ast.newName(res.substring(0, dotIndex)); SimpleName simpleName = ast.newSimpleName(res.substring(dotIndex + 1)); type = ast.newNameQualifiedType(nameQualifier, simpleName); } else { type = ast.newSimpleType(ast.newName(res)); } annotateList(((AnnotatableType) type).annotations(), annotationBinding, ast, context, location, normalizedBinding); } else { type = ast.newSimpleType(ast.newName(res)); } return type; }
private Type createBaseType(AST ast, ImportRewriteContext context, ITypeBinding normalizedBinding, TypeLocation location) { Type type; IAnnotationBinding annotationBinding [] = normalizedBinding.getTypeAnnotations(); boolean annotsPresent = annotationBinding != null && annotationBinding.length > 0; String qualifiedName= getRawQualifiedName(normalizedBinding); String res = qualifiedName.length() > 0 ? internalAddImport(qualifiedName, context) : getRawName(normalizedBinding); if (annotsPresent) { int dotIndex = res != null ? res.lastIndexOf('.') : -1; if (dotIndex > 0) { Name nameQualifier = ast.newName(res.substring(0, dotIndex)); SimpleName simpleName = ast.newSimpleName(res.substring(dotIndex + 1)); type = ast.newNameQualifiedType(nameQualifier, simpleName); } else { type = ast.newSimpleType(ast.newName(res)); } annotateList(((AnnotatableType) type).annotations(), annotationBinding, ast, context, location, normalizedBinding); } else { type = ast.newSimpleType(ast.newName(res)); } return type; }
private Type createBaseType(AST ast, ImportRewriteContext context, ITypeBinding normalizedBinding) { Type type; IAnnotationBinding annotationBinding [] = normalizedBinding.getTypeAnnotations(); boolean annotsPresent = annotationBinding != null && annotationBinding.length > 0; String qualifiedName= getRawQualifiedName(normalizedBinding); String res = qualifiedName.length() > 0 ? internalAddImport(qualifiedName, context) : getRawName(normalizedBinding); if (annotsPresent) { int dotIndex = res != null ? res.lastIndexOf('.') : -1; if (dotIndex > 0) { Name nameQualifier = ast.newName(res.substring(0, dotIndex)); SimpleName simpleName = ast.newSimpleName(res.substring(dotIndex + 1)); type = ast.newNameQualifiedType(nameQualifier, simpleName); } else { type = ast.newSimpleType(ast.newName(res)); } annotateList(((AnnotatableType) type).annotations(), annotationBinding, ast, context); } else { type = ast.newSimpleType(ast.newName(res)); } return type; }
private Type createBaseType(AST ast, ImportRewriteContext context, ITypeBinding normalizedBinding) { Type type; IAnnotationBinding annotationBinding [] = normalizedBinding.getTypeAnnotations(); boolean annotsPresent = annotationBinding != null && annotationBinding.length > 0; String qualifiedName= getRawQualifiedName(normalizedBinding); String res = qualifiedName.length() > 0 ? internalAddImport(qualifiedName, context) : getRawName(normalizedBinding); if (annotsPresent) { int dotIndex = res != null ? res.lastIndexOf('.') : -1; if (dotIndex > 0) { Name nameQualifier = ast.newName(res.substring(0, dotIndex)); SimpleName simpleName = ast.newSimpleName(res.substring(dotIndex + 1)); type = ast.newNameQualifiedType(nameQualifier, simpleName); } else { type = ast.newSimpleType(ast.newName(res)); } annotateList(((AnnotatableType) type).annotations(), annotationBinding, ast, context); } else { type = ast.newSimpleType(ast.newName(res)); } return type; }
private Type createBaseType(AST ast, ImportRewriteContext context, ITypeBinding normalizedBinding) { Type type; IAnnotationBinding annotationBinding [] = normalizedBinding.getTypeAnnotations(); boolean annotsPresent = annotationBinding != null && annotationBinding.length > 0; String qualifiedName= getRawQualifiedName(normalizedBinding); String res = qualifiedName.length() > 0 ? internalAddImport(qualifiedName, context) : getRawName(normalizedBinding); if (annotsPresent) { int dotIndex = res != null ? res.lastIndexOf('.') : -1; if (dotIndex > 0) { Name nameQualifier = ast.newName(res.substring(0, dotIndex)); SimpleName simpleName = ast.newSimpleName(res.substring(dotIndex + 1)); type = ast.newNameQualifiedType(nameQualifier, simpleName); } else { type = ast.newSimpleType(ast.newName(res)); } annotateList(((AnnotatableType) type).annotations(), annotationBinding, ast, context); } else { type = ast.newSimpleType(ast.newName(res)); } return type; }