private Expression getOtherAccess(String name) { return fAst.newQualifiedName(fAst.newSimpleName(VARIABLE_NAME_EQUALS_CASTED), fAst.newSimpleName(name)); }
private Expression getOtherAccess(String name) { return fAst.newQualifiedName(fAst.newSimpleName(VARIABLE_NAME_EQUALS_CASTED), fAst.newSimpleName(name)); }
private Expression getOtherAccess(String name) { return fAst.newQualifiedName(fAst.newSimpleName(VARIABLE_NAME_EQUALS_CASTED), fAst.newSimpleName(name)); }
Name internalNewName(String[] identifiers) { int count = identifiers.length; if (count == 0) { throw new IllegalArgumentException(); } final SimpleName simpleName = new SimpleName(this); simpleName.internalSetIdentifier(identifiers[0]); Name result = simpleName; for (int i = 1; i < count; i++) { SimpleName name = new SimpleName(this); name.internalSetIdentifier(identifiers[i]); result = newQualifiedName(result, name); } return result; }
Name internalNewName(String[] identifiers) { int count = identifiers.length; if (count == 0) { throw new IllegalArgumentException(); } final SimpleName simpleName = new SimpleName(this); simpleName.internalSetIdentifier(identifiers[0]); Name result = simpleName; for (int i = 1; i < count; i++) { SimpleName name = new SimpleName(this); name.internalSetIdentifier(identifiers[i]); result = newQualifiedName(result, name); } return result; }
Name internalNewName(String[] identifiers) { int count = identifiers.length; if (count == 0) { throw new IllegalArgumentException(); } final SimpleName simpleName = new SimpleName(this); simpleName.internalSetIdentifier(identifiers[0]); Name result = simpleName; for (int i = 1; i < count; i++) { SimpleName name = new SimpleName(this); name.internalSetIdentifier(identifiers[i]); result = newQualifiedName(result, name); } return result; }
Name internalNewName(String[] identifiers) { int count = identifiers.length; if (count == 0) { throw new IllegalArgumentException(); } final SimpleName simpleName = new SimpleName(this); simpleName.internalSetIdentifier(identifiers[0]); Name result = simpleName; for (int i = 1; i < count; i++) { SimpleName name = new SimpleName(this); name.internalSetIdentifier(identifiers[i]); result = newQualifiedName(result, name); } return result; }
Name internalNewName(String[] identifiers) { int count = identifiers.length; if (count == 0) { throw new IllegalArgumentException(); } final SimpleName simpleName = new SimpleName(this); simpleName.internalSetIdentifier(identifiers[0]); Name result = simpleName; for (int i = 1; i < count; i++) { SimpleName name = new SimpleName(this); name.internalSetIdentifier(identifiers[i]); result = newQualifiedName(result, name); } return result; }
Name internalNewName(String[] identifiers) { int count = identifiers.length; if (count == 0) { throw new IllegalArgumentException(); } final SimpleName simpleName = new SimpleName(this); simpleName.internalSetIdentifier(identifiers[0]); Name result = simpleName; for (int i = 1; i < count; i++) { SimpleName name = new SimpleName(this); name.internalSetIdentifier(identifiers[i]); result = newQualifiedName(result, name); } return result; }
/** * Returns the name of the service in this directive. * * @return the services name */ public Name getName() { if (this.name == null) { // lazy init must be thread-safe for readers synchronized (this) { if (this.name == null) { preLazyInit(); this.name = this.ast.newQualifiedName( new SimpleName(this.ast), new SimpleName(this.ast)); postLazyInit(this.name, NAME_PROPERTY); } } } return this.name; }
/** * Returns the module name referenced by this declaration. * * @return the module referenced */ public Name getName() { if (this.name == null) { // lazy init must be thread-safe for readers synchronized (this) { if (this.name == null) { preLazyInit(); this.name =this.ast.newQualifiedName( new SimpleName(this.ast), new SimpleName(this.ast)); postLazyInit(this.name, NAME_PROPERTY); } } } return this.name; }
/** * Returns the module name referenced by this declaration. * * @return the module referenced */ public Name getName() { if (this.name == null) { // lazy init must be thread-safe for readers synchronized (this) { if (this.name == null) { preLazyInit(); this.name =this.ast.newQualifiedName( new SimpleName(this.ast), new SimpleName(this.ast)); postLazyInit(this.name, NAME_PROPERTY); } } } return this.name; }
/** * Returns the name of the service in this directive. * * @return the services name */ public Name getName() { if (this.name == null) { // lazy init must be thread-safe for readers synchronized (this) { if (this.name == null) { preLazyInit(); this.name = this.ast.newQualifiedName( new SimpleName(this.ast), new SimpleName(this.ast)); postLazyInit(this.name, NAME_PROPERTY); } } } return this.name; }
private void addArgumentsForLocalsUsedInInnerClass(ClassInstanceCreation newClassCreation) { IVariableBinding[] usedLocals= getUsedLocalVariables(); for (int i= 0; i < usedLocals.length; i++) { final AST ast= fAnonymousInnerClassNode.getAST(); final IVariableBinding binding= usedLocals[i]; Name name= null; if (binding.isEnumConstant()) name= ast.newQualifiedName(ast.newSimpleName(binding.getDeclaringClass().getName()), ast.newSimpleName(binding.getName())); else name= ast.newSimpleName(binding.getName()); newClassCreation.arguments().add(name); } }
private void addArgumentsForLocalsUsedInInnerClass(CompilationUnitRewrite rewrite, ClassInstanceCreation newClassCreation) { IVariableBinding[] usedLocals= getUsedLocalVariables(); for (int i= 0; i < usedLocals.length; i++) { final AST ast= fAnonymousInnerClassNode.getAST(); final IVariableBinding binding= usedLocals[i]; Name name= null; if (binding.isEnumConstant()) name= ast.newQualifiedName(ast.newSimpleName(binding.getDeclaringClass().getName()), ast.newSimpleName(binding.getName())); else name= ast.newSimpleName(binding.getName()); newClassCreation.arguments().add(name); } }
private void addArgumentsForLocalsUsedInInnerClass(ClassInstanceCreation newClassCreation) { IVariableBinding[] usedLocals= getUsedLocalVariables(); for (int i= 0; i < usedLocals.length; i++) { final AST ast= fAnonymousInnerClassNode.getAST(); final IVariableBinding binding= usedLocals[i]; Name name= null; if (binding.isEnumConstant()) name= ast.newQualifiedName(ast.newSimpleName(binding.getDeclaringClass().getName()), ast.newSimpleName(binding.getName())); else name= ast.newSimpleName(binding.getName()); newClassCreation.arguments().add(name); } }
private Expression createFieldAccess(AST ast) throws JavaModelException { String fieldName= fField.getElementName(); if (fArgName.equals(fieldName)) { if (JdtFlags.isStatic(fField)) { return ast.newQualifiedName( ast.newSimpleName(fField.getDeclaringType().getElementName()), ast.newSimpleName(fieldName)); } else { FieldAccess result= ast.newFieldAccess(); result.setExpression(ast.newThisExpression()); result.setName(ast.newSimpleName(fieldName)); return result; } } else { return ast.newSimpleName(fieldName); } }
protected void rewrite(SimpleName node, ITypeBinding type) { AST ast= node.getAST(); Type result= fCuRewrite.getImportRewrite().addImport(type, fCuRewrite.getAST()); fCuRewrite.getImportRemover().registerAddedImport(type.getQualifiedName()); Name dummy= ASTNodeFactory.newName(fCuRewrite.getAST(), ASTFlattener.asString(result)); QualifiedName name= ast.newQualifiedName(dummy, ast.newSimpleName(node.getIdentifier())); fCuRewrite.getASTRewrite().replace(node, name, fCuRewrite.createGroupDescription(REFERENCE_UPDATE)); fCuRewrite.getImportRemover().registerRemovedNode(node); fProcessed.add(node); fNeedsImport= true; }
protected void rewrite(SimpleName node, ITypeBinding type) { AST ast= node.getAST(); ImportRewriteContext context= new ContextSensitiveImportRewriteContext(node, fCuRewrite.getImportRewrite()); Type result= fCuRewrite.getImportRewrite().addImport(type, fCuRewrite.getAST(), context); fCuRewrite.getImportRemover().registerAddedImport(type.getQualifiedName()); Name dummy= ASTNodeFactory.newName(fCuRewrite.getAST(), ASTFlattener.asString(result)); QualifiedName name= ast.newQualifiedName(dummy, ast.newSimpleName(node.getIdentifier())); fCuRewrite.getASTRewrite().replace(node, name, fCuRewrite.createGroupDescription(REFERENCE_UPDATE)); fCuRewrite.getImportRemover().registerRemovedNode(node); fProcessed.add(node); fNeedsImport= true; }
protected void rewrite(SimpleName node, ITypeBinding type) { AST ast= node.getAST(); ImportRewriteContext context= new ContextSensitiveImportRewriteContext(node, fCuRewrite.getImportRewrite()); Type result= fCuRewrite.getImportRewrite().addImport(type, fCuRewrite.getAST(), context); fCuRewrite.getImportRemover().registerAddedImport(type.getQualifiedName()); Name dummy= ASTNodeFactory.newName(fCuRewrite.getAST(), ASTFlattener.asString(result)); QualifiedName name= ast.newQualifiedName(dummy, ast.newSimpleName(node.getIdentifier())); fCuRewrite.getASTRewrite().replace(node, name, fCuRewrite.createGroupDescription(REFERENCE_UPDATE)); fCuRewrite.getImportRemover().registerRemovedNode(node); fProcessed.add(node); fNeedsImport= true; }