protected static SingleVariableDeclaration createPlaceholderForSingleVariableDeclaration(final SingleVariableDeclaration declaration, final ICompilationUnit declaringCu, final ASTRewrite rewrite) throws JavaModelException { return (SingleVariableDeclaration) rewrite.createStringPlaceholder(declaringCu.getBuffer().getText(declaration.getStartPosition(), declaration.getLength()), ASTNode.SINGLE_VARIABLE_DECLARATION); }
protected static SingleVariableDeclaration createPlaceholderForSingleVariableDeclaration(final SingleVariableDeclaration declaration, final ICompilationUnit declaringCu, final ASTRewrite rewrite) throws JavaModelException { return (SingleVariableDeclaration) rewrite.createStringPlaceholder(declaringCu.getBuffer().getText(declaration.getStartPosition(), declaration.getLength()), ASTNode.SINGLE_VARIABLE_DECLARATION); }
protected static SingleVariableDeclaration createPlaceholderForSingleVariableDeclaration(final SingleVariableDeclaration declaration, final ICompilationUnit declaringCu, final ASTRewrite rewrite) throws JavaModelException { return (SingleVariableDeclaration) rewrite.createStringPlaceholder(declaringCu.getBuffer().getText(declaration.getStartPosition(), declaration.getLength()), ASTNode.SINGLE_VARIABLE_DECLARATION); }
ASTNode clone0(AST target) { SingleVariableDeclaration result = new SingleVariableDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.setModifiers(getModifiers()); } else { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); result.setVarargs(isVarargs()); } result.setType((Type) getType().clone(target)); if (this.ast.apiLevel >= AST.JLS8_INTERNAL) { result.varargsAnnotations().addAll( ASTNode.copySubtrees(target, varargsAnnotations())); } result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS8_INTERNAL) { result.extraDimensions().addAll( ASTNode.copySubtrees(target, this.extraDimensions())); } else { result.internalSetExtraDimensions(getExtraDimensions()); } result.setInitializer( (Expression) ASTNode.copySubtree(target, getInitializer())); return result; }
public VariableDeclaration(CompilationUnit cu, String filePath, SingleVariableDeclaration fragment) { this.locationInfo = new LocationInfo(cu, filePath, fragment); this.variableName = fragment.getName().getIdentifier(); this.initializer = fragment.getInitializer() != null ? new AbstractExpression(cu, filePath, fragment.getInitializer()) : null; this.type = UMLType.extractTypeObject(UMLType.getTypeName(extractType(fragment), fragment.getExtraDimensions())); this.variableDeclarationType = extractVariableDeclarationType(fragment); int startOffset = fragment.getStartPosition(); ASTNode scopeNode = getScopeNode(fragment); int endOffset = scopeNode.getStartPosition() + scopeNode.getLength(); this.scope = new VariableScope(cu, filePath, startOffset, endOffset); }
ASTNode clone0(AST target) { SingleVariableDeclaration result = new SingleVariableDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.setModifiers(getModifiers()); } else { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); result.setVarargs(isVarargs()); } result.setType((Type) getType().clone(target)); if (this.ast.apiLevel >= AST.JLS8) { result.varargsAnnotations().addAll( ASTNode.copySubtrees(target, varargsAnnotations())); } result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS8) { result.extraDimensions().addAll( ASTNode.copySubtrees(target, this.extraDimensions())); } else { result.internalSetExtraDimensions(getExtraDimensions()); } result.setInitializer( (Expression) ASTNode.copySubtree(target, getInitializer())); return result; }
@Override ASTNode clone0(AST target) { SingleVariableDeclaration result = new SingleVariableDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.setModifiers(getModifiers()); } else { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); result.setVarargs(isVarargs()); } result.setType((Type) getType().clone(target)); if (this.ast.apiLevel >= AST.JLS8_INTERNAL) { result.varargsAnnotations().addAll( ASTNode.copySubtrees(target, varargsAnnotations())); } result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS8_INTERNAL) { result.extraDimensions().addAll( ASTNode.copySubtrees(target, this.extraDimensions())); } else { result.internalSetExtraDimensions(getExtraDimensions()); } result.setInitializer( (Expression) ASTNode.copySubtree(target, getInitializer())); return result; }
ASTNode clone0(AST target) { SingleVariableDeclaration result = new SingleVariableDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.setModifiers(getModifiers()); } else { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); result.setVarargs(isVarargs()); } result.setType((Type) getType().clone(target)); if (this.ast.apiLevel >= AST.JLS8) { result.varargsAnnotations().addAll( ASTNode.copySubtrees(target, varargsAnnotations())); } result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS8) { result.extraDimensions().addAll( ASTNode.copySubtrees(target, this.extraDimensions())); } else { result.internalSetExtraDimensions(getExtraDimensions()); } result.setInitializer( (Expression) ASTNode.copySubtree(target, getInitializer())); return result; }
ASTNode clone0(AST target) { SingleVariableDeclaration result = new SingleVariableDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.setModifiers(getModifiers()); } else { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); result.setVarargs(isVarargs()); } result.setType((Type) getType().clone(target)); if (this.ast.apiLevel >= AST.JLS8) { result.varargsAnnotations().addAll( ASTNode.copySubtrees(target, varargsAnnotations())); } result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS8) { result.extraDimensions().addAll( ASTNode.copySubtrees(target, this.extraDimensions())); } else { result.internalSetExtraDimensions(getExtraDimensions()); } result.setInitializer( (Expression) ASTNode.copySubtree(target, getInitializer())); return result; }
return doVisitUnchangedChildren(node); int pos= node.getStartPosition(); int apiLevel= node.getAST().apiLevel(); if (apiLevel == JLS2_INTERNAL) { pos= rewriteVarargsAnnotations(node, SingleVariableDeclaration.VARARGS_ANNOTATIONS_PROPERTY, pos); int indent= getIndent(node.getStartPosition()); String prefix= this.formatter.VARARGS.getPrefix(indent); doTextInsert(pos, prefix, editGroup); pos= node.getStartPosition() + node.getLength(); // insert pos
ASTNode clone0(AST target) { SingleVariableDeclaration result = new SingleVariableDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.setModifiers(getModifiers()); } else { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); result.setVarargs(isVarargs()); } result.setType((Type) getType().clone(target)); result.setExtraDimensions(getExtraDimensions()); result.setName((SimpleName) getName().clone(target)); result.setInitializer( (Expression) ASTNode.copySubtree(target, getInitializer())); return result; }
return doVisitUnchangedChildren(node); int pos= node.getStartPosition(); int apiLevel= node.getAST().apiLevel(); if (apiLevel == JLS2_INTERNAL) { pos= rewriteVarargsAnnotations(node, SingleVariableDeclaration.VARARGS_ANNOTATIONS_PROPERTY, pos); int indent= getIndent(node.getStartPosition()); String prefix= this.formatter.VARARGS.getPrefix(indent); doTextInsert(pos, prefix, editGroup); pos= node.getStartPosition() + node.getLength(); // insert pos
return doVisitUnchangedChildren(node); int pos= node.getStartPosition(); int apiLevel= node.getAST().apiLevel(); if (apiLevel == JLS2_INTERNAL) { pos= rewriteVarargsAnnotations(node, SingleVariableDeclaration.VARARGS_ANNOTATIONS_PROPERTY, pos); int indent= getIndent(node.getStartPosition()); String prefix= this.formatter.VARARGS.getPrefix(indent); doTextInsert(pos, prefix, editGroup); pos= node.getStartPosition() + node.getLength(); // insert pos
return doVisitUnchangedChildren(node); int pos= node.getStartPosition(); int apiLevel= node.getAST().apiLevel(); if (apiLevel == JLS2_INTERNAL) { pos= rewriteVarargsAnnotations(node, SingleVariableDeclaration.VARARGS_ANNOTATIONS_PROPERTY, pos); int indent= getIndent(node.getStartPosition()); String prefix= this.formatter.VARARGS.getPrefix(indent); doTextInsert(pos, prefix, editGroup); pos= node.getStartPosition() + node.getLength(); // insert pos
return doVisitUnchangedChildren(node); int pos= node.getStartPosition(); int apiLevel= node.getAST().apiLevel(); if (apiLevel == JLS2_INTERNAL) { pos= rewriteVarargsAnnotations(node, SingleVariableDeclaration.VARARGS_ANNOTATIONS_PROPERTY, pos); int indent= getIndent(node.getStartPosition()); String prefix= this.formatter.VARARGS.getPrefix(indent); doTextInsert(pos, prefix, editGroup); pos= node.getStartPosition() + node.getLength(); // insert pos
return doVisitUnchangedChildren(node); int pos= node.getStartPosition(); if (node.getAST().apiLevel() == JLS2_INTERNAL) { rewriteModifiers(node, SingleVariableDeclaration.MODIFIERS_PROPERTY, pos); pos= node.getStartPosition() + node.getLength(); // insert pos
private void mapMethodParameters(MethodDeclaration node, CSMethod method) { for (Object o : node.parameters()) { SingleVariableDeclaration p = (SingleVariableDeclaration) o; ITypeBinding parameterType = p.getType().resolveBinding(); if (isGenericRuntimeParameterIdiom(node.resolveBinding(), parameterType)) { // System.Type <p.name> = typeof(<T>); method.body().addStatement( new CSDeclarationStatement(p.getStartPosition(), new CSVariableDeclaration(identifier(p .getName()), new CSTypeReference("System.Type"), new CSTypeofExpression( genericRuntimeTypeIdiomType(parameterType))))); } else { mapParameter(p, method); } } }
} while (i < parametersLength); if (thrownExceptionsLength == 0) { methodHeaderEnd = parameter.getStartPosition() + parameter.getLength();
} while (i < parametersLength); if (thrownExceptionsLength == 0) { methodHeaderEnd = parameter.getStartPosition() + parameter.getLength();
} while (i < parametersLength); if (thrownExceptionsLength == 0) { methodHeaderEnd = parameter.getStartPosition() + parameter.getLength();