private SingleVariableDeclaration newParameterDeclaration(AST ast, ImportRewrite importRewrite, String paramName, ITypeBinding paramType) { SingleVariableDeclaration param= ast.newSingleVariableDeclaration(); param.setExtraDimensions(0); param.setInitializer(null); param.setType(importRewrite.addImport(paramType, ast)); param.setName(ast.newSimpleName(paramName)); return param; }
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == TYPE_PROPERTY) { if (get) { return getType(); } else { setType((Type) child); return null; } } if (property == NAME_PROPERTY) { if (get) { return getName(); } else { setName((SimpleName) child); return null; } } if (property == INITIALIZER_PROPERTY) { if (get) { return getInitializer(); } else { setInitializer((Expression) child); return null; } } // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); }
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == TYPE_PROPERTY) { if (get) { return getType(); } else { setType((Type) child); return null; } } if (property == NAME_PROPERTY) { if (get) { return getName(); } else { setName((SimpleName) child); return null; } } if (property == INITIALIZER_PROPERTY) { if (get) { return getInitializer(); } else { setInitializer((Expression) child); return null; } } // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); }
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == TYPE_PROPERTY) { if (get) { return getType(); } else { setType((Type) child); return null; } } if (property == NAME_PROPERTY) { if (get) { return getName(); } else { setName((SimpleName) child); return null; } } if (property == INITIALIZER_PROPERTY) { if (get) { return getInitializer(); } else { setInitializer((Expression) child); return null; } } // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); }
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == TYPE_PROPERTY) { if (get) { return getType(); } else { setType((Type) child); return null; } } if (property == NAME_PROPERTY) { if (get) { return getName(); } else { setName((SimpleName) child); return null; } } if (property == INITIALIZER_PROPERTY) { if (get) { return getInitializer(); } else { setInitializer((Expression) child); return null; } } // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); }
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == NAME_PROPERTY) { if (get) { return getName(); } else { setName((SimpleName) child); return null; } } if (property == TYPE_PROPERTY) { if (get) { return getType(); } else { setType((Type) child); return null; } } if (property == INITIALIZER_PROPERTY) { if (get) { return getInitializer(); } else { setInitializer((Expression) child); return null; } } // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); }
@Override final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == TYPE_PROPERTY) { if (get) { return getType(); } else { setType((Type) child); return null; } } if (property == NAME_PROPERTY) { if (get) { return getName(); } else { setName((SimpleName) child); return null; } } if (property == INITIALIZER_PROPERTY) { if (get) { return getInitializer(); } else { setInitializer((Expression) child); return null; } } // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); }
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; }
@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; }
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)); result.setExtraDimensions(getExtraDimensions()); result.setName((SimpleName) getName().clone(target)); result.setInitializer( (Expression) ASTNode.copySubtree(target, getInitializer())); return result; }