@Override public boolean isWildcard() { return imprt.isOnDemand(); }
@Override public boolean isWildcard() { return imprt.isOnDemand(); }
/** * Return <code>true</code> if original import was an "on demand" import. * * @see org.eclipse.emf.codegen.merge.java.facade.JImport#isOnDemand() */ public boolean isOnDemand() { // always returns original value return getASTNode().isOnDemand(); }
/** * Return <code>true</code> if original import was an "on demand" import. * * @see org.eclipse.emf.codegen.merge.java.facade.JImport#isOnDemand() */ public boolean isOnDemand() { // always returns original value return getASTNode().isOnDemand(); }
private static String getFullName(ImportDeclaration decl) { String name= decl.getName().getFullyQualifiedName(); return decl.isOnDemand() ? name + ".*": name; //$NON-NLS-1$ }
@Override public boolean visit(final ImportDeclaration node) { if (node.isStatic()) { if (node.isOnDemand()) { staticImports.add(node.getName().getFullyQualifiedName() + ".*"); } else { staticImports.add(node.getName().getFullyQualifiedName()); } } return VISIT_SUBTREE; }
private String getQualifier(ImportDeclaration decl) { String name = decl.getName().getFullyQualifiedName(); /* * If it's on demand import, return the fully qualified name. (e.g. pack1.Foo.* => pack.Foo, pack1.* => pack1) * This is because we need to have pack1.Foo.* and pack1.Bar under different qualifier groups. */ if (decl.isOnDemand()) { return name; } return getQualifier(name, decl.isStatic()); }
private String getQualifier(ImportDeclaration decl) { String name = decl.getName().getFullyQualifiedName(); /* * If it's on demand import, return the fully qualified name. (e.g. pack1.Foo.* => pack.Foo, pack1.* => pack1) * This is because we need to have pack1.Foo.* and pack1.Bar under different qualifier groups. */ if (decl.isOnDemand()) { return name; } return getQualifier(name, decl.isStatic()); }
private String getQualifier(ImportDeclaration decl) { String name = decl.getName().getFullyQualifiedName(); /* * If it's on demand import, return the fully qualified name. (e.g. pack1.Foo.* => pack.Foo, pack1.* => pack1) * This is because we need to have pack1.Foo.* and pack1.Bar under different qualifier groups. */ if (decl.isOnDemand()) { return name; } return getQualifier(name, decl.isStatic()); }
public static boolean isStaticMethodImport(ImportDeclaration imp, IMethodBinding method) { final IBinding binding = imp.resolveBinding(); switch (binding.getKind()) { case IBinding.TYPE: return imp.isOnDemand() && method.getDeclaringClass() == binding; case IBinding.METHOD: IMethodBinding bound = (IMethodBinding) binding; return bound.getDeclaringClass() == method.getDeclaringClass() && binding.getName().equals(method.getMethodDeclaration().getName()); } return false; }
static ImportName createFor(ImportDeclaration importDeclaration) { String declName = importDeclaration.getName().getFullyQualifiedName(); if (importDeclaration.isOnDemand()) { return createOnDemand(importDeclaration.isStatic(), declName); } return createFor(importDeclaration.isStatic(), declName); }
static ImportName createFor(ImportDeclaration importDeclaration) { String declName = importDeclaration.getName().getFullyQualifiedName(); if (importDeclaration.isOnDemand()) { return createOnDemand(importDeclaration.isStatic(), declName); } return createFor(importDeclaration.isStatic(), declName); }
static ImportName createFor(ImportDeclaration importDeclaration) { String declName = importDeclaration.getName().getFullyQualifiedName(); if (importDeclaration.isOnDemand()) { return createOnDemand(importDeclaration.isStatic(), declName); } return createFor(importDeclaration.isStatic(), declName); }
@Override ASTNode clone0(AST target) { ImportDeclaration result = new ImportDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setOnDemand(isOnDemand()); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.setStatic(isStatic()); } result.setName((Name) getName().clone(target)); return result; }
ASTNode clone0(AST target) { ImportDeclaration result = new ImportDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setOnDemand(isOnDemand()); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.setStatic(isStatic()); } result.setName((Name) getName().clone(target)); return result; }
ASTNode clone0(AST target) { ImportDeclaration result = new ImportDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setOnDemand(isOnDemand()); if (this.ast.apiLevel >= AST.JLS3) { result.setStatic(isStatic()); } result.setName((Name) getName().clone(target)); return result; }
ASTNode clone0(AST target) { ImportDeclaration result = new ImportDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setOnDemand(isOnDemand()); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.setStatic(isStatic()); } result.setName((Name) getName().clone(target)); return result; }
ASTNode clone0(AST target) { ImportDeclaration result = new ImportDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setOnDemand(isOnDemand()); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.setStatic(isStatic()); } result.setName((Name) getName().clone(target)); return result; }
ASTNode clone0(AST target) { ImportDeclaration result = new ImportDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setOnDemand(isOnDemand()); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.setStatic(isStatic()); } result.setName((Name) getName().clone(target)); return result; }
public boolean visit(ImportDeclaration node) { String name = node.getName().getFullyQualifiedName(); IValueList importModifiers = new IValueList(values); if (node.getAST().apiLevel() >= AST.JLS3) { if (node.isStatic()) importModifiers.add(constructModifierNode("static")); if (node.isOnDemand()) importModifiers.add(constructModifierNode("onDemand")); } ownValue = constructDeclarationNode("import", values.string(name)); setKeywordParameters("modifiers", importModifiers); return false; }