@Override public String getName() { return annotation.getTypeName().getFullyQualifiedName(); }
/** * Get the fully qualified name from the <code>Name</code>. * * @param name - the name to process. * @return a FQN of the name. */ public static String getName( Name name ) { CheckArg.isNotNull(name, "name"); return name.getFullyQualifiedName(); }
public boolean visit(SimpleType node) { Name name = node.getName(); types.add(name.getFullyQualifiedName()); return false; }
@Override public boolean visit(SimpleType node) { buffer.append(node.getName().getFullyQualifiedName()); return false; } @Override
@Override protected String convertExpression(Expression expression) { switch (expression.getNodeType()) { case ASTNode.QUALIFIED_NAME: case ASTNode.SIMPLE_NAME: return ((Name) expression).getFullyQualifiedName(); default: return null; } }
@Override public String getQualifiedName() { return imprt.getName().getFullyQualifiedName(); }
@Override public boolean visit(final ImportDeclaration node) { final String qName = node.getName().getFullyQualifiedName(); if (!node.isStatic()) { importedNames.put(qName.substring(qName.lastIndexOf('.') + 1), qName); } else { final String name = qName.substring(qName.lastIndexOf('.') + 1); if (Character.isLowerCase(name.charAt(0))) // ignore constants methodImports.put(name, qName.substring(0, qName.lastIndexOf('.'))); } return false; }
@Override public boolean visit(NameQualifiedType node) { buffer.append(node.getQualifier().getFullyQualifiedName()); buffer.append('.'); buffer.append(node.getName().getIdentifier()); return false; } @Override
@Override public String getPackage() { PackageDeclaration pkg = unit.getPackage(); if (pkg != null) { return pkg.getName().getFullyQualifiedName(); } return null; }
public static String getQualifier(Name name) { if (name.isQualifiedName()) { return ((QualifiedName) name).getQualifier().getFullyQualifiedName(); } return ""; //$NON-NLS-1$ }
public String importFor(String shortName, boolean static_) { if (shortName.indexOf('.') != -1) { return shortName; } List<ImportDeclaration> imports = this.imports(this.compilationUnit()); for (ImportDeclaration importDeclaration : imports) { if (this.importIsFor(importDeclaration, shortName, static_)) { return importDeclaration.getName().getFullyQualifiedName(); } } return null; }
public boolean visit(MarkerAnnotation node) { IValue typeName = values.string(node.getTypeName().getFullyQualifiedName()); ownValue = constructExpressionNode("markerAnnotation", typeName); return false; }
@Override public String getPackage() { if (isWildcard()) { return imprt.getName().getFullyQualifiedName(); } return Types.getPackage(getQualifiedName()); } }
@Override public boolean visit(SimpleType node) { String vName = ""; if (fInMethodDeclaration) { vName += getCurrentParent().getLabel() + COLON_SPACE; } pushNode(node, vName + node.getName().getFullyQualifiedName()); return false; }
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 boolean visit(SingleMemberAnnotation node) { IValue name = values.string(node.getTypeName().getFullyQualifiedName()); IValue value = visitChild(node.getValue()); ownValue = constructExpressionNode("singleMemberAnnotation", name, value); 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); }
private boolean addPossibleStaticImport(Name node, IMethodBinding binding) { if (binding == null || node == null || !(fTarget instanceof IMethodBinding) || !Modifier.isStatic(binding.getModifiers())) return false; IMethodBinding targetMethodBinding= (IMethodBinding)fTarget; if ((fTargetIsStaticMethodImport || Modifier.isStatic(targetMethodBinding.getModifiers())) && (targetMethodBinding.getDeclaringClass().getTypeDeclaration() == binding.getDeclaringClass().getTypeDeclaration())) { if (node.getFullyQualifiedName().equals(targetMethodBinding.getName())) { fResult.add(new OccurrenceLocation(node.getStartPosition(), node.getLength(), 0, fReadDescription)); return true; } } return false; }
private Expression createFieldAccess(ParameterInfo pi, AST ast, Expression qualifier) { if (qualifier instanceof Name) { Name name= (Name) qualifier; //create FQN for IPOR return ast.newName(JavaModelUtil.concatenateName(name.getFullyQualifiedName(), pi.getNewName())); } FieldAccess fa= ast.newFieldAccess(); fa.setName(ast.newSimpleName(pi.getNewName())); fa.setExpression(qualifier); return fa; }