cu.imports().add(id);
@SuppressWarnings("unchecked") @Override public List<Import> getImports() { List<Import> results = new ArrayList<>(); for (ImportDeclaration i : (List<ImportDeclaration>) unit.imports()) { results.add(new ImportImpl(this, i)); } return Collections.unmodifiableList(results); }
private Set /* String */ getExistingImports(CompilationUnit root) { List imports= root.imports(); Set res= new HashSet(imports.size()); for (int i= 0; i < imports.size(); i++) { res.add(ASTNodes.asString((ImportDeclaration) imports.get(i))); } return res; }
@Override @SuppressWarnings("unchecked") public List<Import> getImports() { List<Import> results = new ArrayList<Import>(); for (ImportDeclaration i : (List<ImportDeclaration>) unit.imports()) { results.add(new ImportImpl(this, i)); } return Collections.unmodifiableList(results); }
@Override public boolean visit(CompilationUnit node) { List<ImportDeclaration> imports = node.imports(); if (!imports.isEmpty()) { this.importsStart = this.tm.firstIndexIn(imports.get(0), -1); this.importsEnd = this.tm.lastIndexIn(imports.get(imports.size() - 1), -1); } return true; }
@Override public boolean visit(CompilationUnit node) { List<ImportDeclaration> imports = node.imports(); if (!imports.isEmpty()) { this.importsStart = this.tm.firstIndexIn(imports.get(0), -1); this.importsEnd = this.tm.lastIndexIn(imports.get(imports.size() - 1), -1); } return true; }
@Override public boolean visit(CompilationUnit node) { List<ImportDeclaration> imports = node.imports(); if (!imports.isEmpty()) { this.importsStart = this.tm.firstIndexIn(imports.get(0), -1); this.importsEnd = this.tm.lastIndexIn(imports.get(imports.size() - 1), -1); } return true; }
private static Collection<ImportDeclaration> determineUnresolvableImports(CompilationUnit cu) { Collection<ImportDeclaration> unresolvableImports= new ArrayList<>(cu.imports().size()); for (IProblem problem : cu.getProblems()) { if (problem.getID() == IProblem.ImportNotFound) { ImportDeclaration problematicImport= getProblematicImport(problem, cu); if (problematicImport != null) { unresolvableImports.add(problematicImport); } } } return unresolvableImports; }
@Override final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == IMPORTS_PROPERTY) { return imports(); } if (property == TYPES_PROPERTY) { return types(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == IMPORTS_PROPERTY) { return imports(); } if (property == TYPES_PROPERTY) { return types(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == IMPORTS_PROPERTY) { return imports(); } if (property == TYPES_PROPERTY) { return types(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == IMPORTS_PROPERTY) { return imports(); } if (property == TYPES_PROPERTY) { return types(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
public void endVisit(CompilationUnit node) { if (skipNode(node)) return; GenericSequentialFlowInfo info= processSequential(node, node.imports()); process(info, node.types()); }
@Override public void endVisit(CompilationUnit node) { if (skipNode(node)) { return; } GenericSequentialFlowInfo info = processSequential(node, node.imports()); process(info, node.types()); }
@Override public void endVisit(CompilationUnit node) { if (skipNode(node)) return; GenericSequentialFlowInfo info= processSequential(node, node.imports()); process(info, node.types()); }
ASTNode clone0(AST target) { CompilationUnit result = new CompilationUnit(target); // n.b do not copy line number table or messages result.setSourceRange(getStartPosition(), getLength()); result.setPackage( (PackageDeclaration) ASTNode.copySubtree(target, getPackage())); result.imports().addAll(ASTNode.copySubtrees(target, imports())); result.types().addAll(ASTNode.copySubtrees(target, types())); return result; }
ASTNode clone0(AST target) { CompilationUnit result = new CompilationUnit(target); // n.b do not copy line number table or messages result.setSourceRange(getStartPosition(), getLength()); result.setPackage( (PackageDeclaration) ASTNode.copySubtree(target, getPackage())); result.imports().addAll(ASTNode.copySubtrees(target, imports())); result.types().addAll(ASTNode.copySubtrees(target, types())); return result; }
private String resolveTargetMethodName(CSExpression targetExpression, MethodInvocation node) { final IMethodBinding method = staticImportMethodBinding(node.getName(), _ast.imports()); if(method != null && targetExpression == null){ return mappedTypeName(method.getDeclaringClass()) + "." + mappedMethodName(node.resolveMethodBinding()); } return mappedMethodName(node.resolveMethodBinding()); }