@Override public boolean isStatic() { return imprt.isStatic(); }
@Override public boolean isStatic() { return imprt.isStatic(); }
private static boolean isStaticImport(ASTNode node) { if (!(node instanceof QualifiedName)) return false; ASTNode parent= ((QualifiedName)node).getParent(); return parent instanceof ImportDeclaration && ((ImportDeclaration) parent).isStatic(); }
private static boolean isStaticImport(ASTNode node) { if (!(node instanceof QualifiedName)) return false; ASTNode parent= ((QualifiedName)node).getParent(); return parent instanceof ImportDeclaration && ((ImportDeclaration)parent).isStatic(); }
private static boolean isStaticImport(ASTNode node) { if (!(node instanceof QualifiedName)) return false; ASTNode parent= ((QualifiedName)node).getParent(); return parent instanceof ImportDeclaration && ((ImportDeclaration) parent).isStatic(); }
protected boolean importIsFor(ImportDeclaration importDeclaration, String shortName, boolean static_) { if (importDeclaration.isStatic() != static_) { return false; } String importDeclarationName = importDeclaration.getName().getFullyQualifiedName(); return importDeclarationName.endsWith(shortName); }
/** * Returns original flags. * <p> * For import, only {@link FacadeFlags#STATIC} flag is set. * * @see org.eclipse.emf.codegen.merge.java.facade.AbstractJNode#getFlags() */ @Override public int getFlags() { return getASTNode().isStatic() ? FacadeFlags.STATIC : super.getFlags(); }
/** * Returns original flags. * <p> * For import, only {@link FacadeFlags#STATIC} flag is set. * * @see org.eclipse.emf.codegen.merge.java.facade.AbstractJNode#getFlags() */ @Override public int getFlags() { return getASTNode().isStatic() ? FacadeFlags.STATIC : super.getFlags(); }
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 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()); }
@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_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; }
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; }