/** * Returns the standard dot-separated representation of this name. * If the name is a simple name, the result is the name's identifier. * If the name is a qualified name, the result is the name of the qualifier * (as computed by this method) followed by "." followed by the name's * identifier. * * @return the fully qualified name * @since 3.0 */ public final String getFullyQualifiedName() { if (isSimpleName()) { // avoid creating garbage for common case return ((SimpleName) this).getIdentifier(); } else { StringBuffer buffer = new StringBuffer(50); appendName(buffer); return new String(buffer); } }
/** * Returns the standard dot-separated representation of this name. * If the name is a simple name, the result is the name's identifier. * If the name is a qualified name, the result is the name of the qualifier * (as computed by this method) followed by "." followed by the name's * identifier. * * @return the fully qualified name * @since 3.0 */ public final String getFullyQualifiedName() { if (isSimpleName()) { // avoid creating garbage for common case return ((SimpleName) this).getIdentifier(); } else { StringBuffer buffer = new StringBuffer(50); appendName(buffer); return new String(buffer); } }
/** * Returns the standard dot-separated representation of this name. * If the name is a simple name, the result is the name's identifier. * If the name is a qualified name, the result is the name of the qualifier * (as computed by this method) followed by "." followed by the name's * identifier. * * @return the fully qualified name * @since 3.0 */ public final String getFullyQualifiedName() { if (isSimpleName()) { // avoid creating garbage for common case return ((SimpleName) this).getIdentifier(); } else { StringBuffer buffer = new StringBuffer(50); appendName(buffer); return new String(buffer); } }
/** * Returns the standard dot-separated representation of this name. * If the name is a simple name, the result is the name's identifier. * If the name is a qualified name, the result is the name of the qualifier * (as computed by this method) followed by "." followed by the name's * identifier. * * @return the fully qualified name * @since 3.0 */ public final String getFullyQualifiedName() { if (isSimpleName()) { // avoid creating garbage for common case return ((SimpleName) this).getIdentifier(); } else { StringBuffer buffer = new StringBuffer(50); appendName(buffer); return new String(buffer); } }
/** * Returns the standard dot-separated representation of this name. * If the name is a simple name, the result is the name's identifier. * If the name is a qualified name, the result is the name of the qualifier * (as computed by this method) followed by "." followed by the name's * identifier. * * @return the fully qualified name * @since 3.0 */ public final String getFullyQualifiedName() { if (isSimpleName()) { // avoid creating garbage for common case return ((SimpleName) this).getIdentifier(); } else { StringBuffer buffer = new StringBuffer(50); appendName(buffer); return new String(buffer); } }
/** * Returns the standard dot-separated representation of this name. * If the name is a simple name, the result is the name's identifier. * If the name is a qualified name, the result is the name of the qualifier * (as computed by this method) followed by "." followed by the name's * identifier. * * @return the fully qualified name * @since 3.0 */ public final String getFullyQualifiedName() { if (isSimpleName()) { // avoid creating garbage for common case return ((SimpleName) this).getIdentifier(); } else { StringBuffer buffer = new StringBuffer(50); appendName(buffer); return new String(buffer); } }
@Override public boolean visit(SimpleType type) { if (type.getName().isSimpleName()) { ignoredSimpleNames.add(type.getName().getFullyQualifiedName()); } return true; } };
public boolean isMissingType(final Type type) { if ((type instanceof SimpleType)) { boolean _isSimpleName = ((SimpleType)type).getName().isSimpleName(); if (_isSimpleName) { Name _name = ((SimpleType)type).getName(); return "MISSING".equals(((SimpleName) _name).getIdentifier()); } } return false; }
private static boolean hasNullAnnotation(MethodDeclaration decl) { List<IExtendedModifier> modifiers= decl.modifiers(); String nonnull= NullAnnotationsFix.getNonNullAnnotationName(decl.resolveBinding().getJavaElement(), false); String nullable= NullAnnotationsFix.getNullableAnnotationName(decl.resolveBinding().getJavaElement(), false); for (Object mod : modifiers) { if (mod instanceof Annotation) { Name annotationName= ((Annotation) mod).getTypeName(); String fullyQualifiedName= annotationName.getFullyQualifiedName(); if (annotationName.isSimpleName() ? nonnull.endsWith(fullyQualifiedName) : fullyQualifiedName.equals(nonnull)) return true; if (annotationName.isSimpleName() ? nullable.endsWith(fullyQualifiedName) : fullyQualifiedName.equals(nullable)) return true; } } return false; }
private boolean hasNullAnnotation(MethodDeclaration decl) { List<IExtendedModifier> modifiers= decl.modifiers(); String nonnull= NullAnnotationsFix.getNonNullAnnotationName(decl.resolveBinding().getJavaElement(), false); String nullable= NullAnnotationsFix.getNullableAnnotationName(decl.resolveBinding().getJavaElement(), false); for (Object mod : modifiers) { if (mod instanceof Annotation) { Name annotationName= ((Annotation) mod).getTypeName(); String fullyQualifiedName= annotationName.getFullyQualifiedName(); if (annotationName.isSimpleName() ? nonnull.endsWith(fullyQualifiedName) : fullyQualifiedName.equals(nonnull)) return true; if (annotationName.isSimpleName() ? nullable.endsWith(fullyQualifiedName) : fullyQualifiedName.equals(nullable)) return true; } } return false; }
public boolean visit(final ThisExpression node) { Assert.isNotNull(node); final Name name= node.getQualifier(); if (name != null && name.isSimpleName()) { final AST ast= node.getAST(); Expression expression= null; if (fCodeGenerationSettings.useKeywordThis || fEnclosingInstanceFieldName.equals(fNameForEnclosingInstanceConstructorParameter)) { final FieldAccess access= ast.newFieldAccess(); access.setExpression(ast.newThisExpression()); access.setName(ast.newSimpleName(fEnclosingInstanceFieldName)); expression= access; } else expression= ast.newSimpleName(fEnclosingInstanceFieldName); fSourceRewrite.getASTRewrite().replace(node, expression, null); } return super.visit(node); } }
private static SimpleName getSelectedName(CompilationUnit compilationUnit, IProblemLocation problem) { final ASTNode selection= problem.getCoveredNode(compilationUnit); if (selection == null) return null; Name name= null; if (selection instanceof SimpleType) { final SimpleType type= (SimpleType) selection; name= type.getName(); } else if (selection instanceof ParameterizedType) { final ParameterizedType type= (ParameterizedType) selection; final Type raw= type.getType(); if (raw instanceof SimpleType) name= ((SimpleType) raw).getName(); else if (raw instanceof QualifiedType) name= ((QualifiedType) raw).getName(); } else if (selection instanceof Name) { name= (Name) selection; } if (name == null) return null; if (name.isSimpleName()) { return (SimpleName)name; } else { return ((QualifiedName)name).getName(); } }
if (name.isSimpleName()) { return (SimpleName) name; } else {
return null; if (name.isSimpleName()) { return (SimpleName)name; } else {
return null; if (name.isSimpleName()) { return (SimpleName)name; } else {
if (importRewrite != null && node.isSimpleName() && simpleName.equals(((SimpleName) node).getIdentifier())) { // import only
if (importRewrite != null && node.isSimpleName() && simpleName.equals(((SimpleName) node).getIdentifier())) { // import only
if (importRewrite != null && node.isSimpleName() && simpleName.equals(((SimpleName) node).getIdentifier())) { // import only
if (importRewrite != null && node.isSimpleName() && simpleName.equals(((SimpleName) node).getIdentifier())) { // import only
if (importRewrite != null && node.isSimpleName() && simpleName.equals(((SimpleName) node).getIdentifier())) { // import only