/** * Creates a new unparented field declaration node owned by this AST, * for the given variable declaration fragment. By default, there are no * modifiers, no doc comment, and the base type is unspecified * (but legal). * <p> * This method can be used to wrap a variable declaration fragment * (<code>VariableDeclarationFragment</code>) into a field declaration * suitable for inclusion in the body of a type declaration * (<code>FieldDeclaration</code> implements <code>BodyDeclaration</code>). * Additional variable declaration fragments can be added afterwards. * </p> * * @param fragment the variable declaration fragment * @return a new unparented field declaration node * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * <li>the given fragment is null</li> * </ul> */ public FieldDeclaration newFieldDeclaration(VariableDeclarationFragment fragment) { if (fragment == null) { throw new IllegalArgumentException(); } FieldDeclaration result = new FieldDeclaration(this); result.fragments().add(fragment); return result; }
/** * Creates a new unparented field declaration node owned by this AST, * for the given variable declaration fragment. By default, there are no * modifiers, no doc comment, and the base type is unspecified * (but legal). * <p> * This method can be used to wrap a variable declaration fragment * (<code>VariableDeclarationFragment</code>) into a field declaration * suitable for inclusion in the body of a type declaration * (<code>FieldDeclaration</code> implements <code>BodyDeclaration</code>). * Additional variable declaration fragments can be added afterwards. * </p> * * @param fragment the variable declaration fragment * @return a new unparented field declaration node * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * <li>the given fragment is null</li> * </ul> */ public FieldDeclaration newFieldDeclaration(VariableDeclarationFragment fragment) { if (fragment == null) { throw new IllegalArgumentException(); } FieldDeclaration result = new FieldDeclaration(this); result.fragments().add(fragment); return result; }
/** * Creates a new unparented field declaration node owned by this AST, * for the given variable declaration fragment. By default, there are no * modifiers, no doc comment, and the base type is unspecified * (but legal). * <p> * This method can be used to wrap a variable declaration fragment * (<code>VariableDeclarationFragment</code>) into a field declaration * suitable for inclusion in the body of a type declaration * (<code>FieldDeclaration</code> implements <code>BodyDeclaration</code>). * Additional variable declaration fragments can be added afterwards. * </p> * * @param fragment the variable declaration fragment * @return a new unparented field declaration node * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * <li>the given fragment is null</li> * </ul> */ public FieldDeclaration newFieldDeclaration(VariableDeclarationFragment fragment) { if (fragment == null) { throw new IllegalArgumentException(); } FieldDeclaration result = new FieldDeclaration(this); result.fragments().add(fragment); return result; }
/** * Creates a new unparented field declaration node owned by this AST, * for the given variable declaration fragment. By default, there are no * modifiers, no doc comment, and the base type is unspecified * (but legal). * <p> * This method can be used to wrap a variable declaration fragment * (<code>VariableDeclarationFragment</code>) into a field declaration * suitable for inclusion in the body of a type declaration * (<code>FieldDeclaration</code> implements <code>BodyDeclaration</code>). * Additional variable declaration fragments can be added afterwards. * </p> * * @param fragment the variable declaration fragment * @return a new unparented field declaration node * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * <li>the given fragment is null</li> * </ul> */ public FieldDeclaration newFieldDeclaration(VariableDeclarationFragment fragment) { if (fragment == null) { throw new IllegalArgumentException(); } FieldDeclaration result = new FieldDeclaration(this); result.fragments().add(fragment); return result; }
/** * Creates a new unparented field declaration node owned by this AST, * for the given variable declaration fragment. By default, there are no * modifiers, no doc comment, and the base type is unspecified * (but legal). * <p> * This method can be used to wrap a variable declaration fragment * (<code>VariableDeclarationFragment</code>) into a field declaration * suitable for inclusion in the body of a type declaration * (<code>FieldDeclaration</code> implements <code>BodyDeclaration</code>). * Additional variable declaration fragments can be added afterwards. * </p> * * @param fragment the variable declaration fragment * @return a new unparented field declaration node * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * <li>the given fragment is null</li> * </ul> */ public FieldDeclaration newFieldDeclaration(VariableDeclarationFragment fragment) { if (fragment == null) { throw new IllegalArgumentException(); } FieldDeclaration result = new FieldDeclaration(this); result.fragments().add(fragment); return result; }
throw new IllegalArgumentException(); FieldDeclaration result = new FieldDeclaration(this); result.fragments().add(fragment); return result;
protected FieldDeclaration convertToFieldDeclaration(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration fieldDecl) { VariableDeclarationFragment variableDeclarationFragment = convertToVariableDeclarationFragment(fieldDecl); final FieldDeclaration fieldDeclaration = new FieldDeclaration(this.ast); fieldDeclaration.fragments().add(variableDeclarationFragment); if (this.resolveBindings) { recordNodes(variableDeclarationFragment, fieldDecl); variableDeclarationFragment.resolveBinding(); } fieldDeclaration.setSourceRange(fieldDecl.declarationSourceStart, fieldDecl.declarationEnd - fieldDecl.declarationSourceStart + 1); Type type = convertType(fieldDecl.type); setTypeForField(fieldDeclaration, type, variableDeclarationFragment.getExtraDimensions()); setModifiers(fieldDeclaration, fieldDecl); convert(fieldDecl.javadoc, fieldDeclaration); return fieldDeclaration; }
protected FieldDeclaration convertToFieldDeclaration(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration fieldDecl) { VariableDeclarationFragment variableDeclarationFragment = convertToVariableDeclarationFragment(fieldDecl); final FieldDeclaration fieldDeclaration = new FieldDeclaration(this.ast); fieldDeclaration.fragments().add(variableDeclarationFragment); if (this.resolveBindings) { recordNodes(variableDeclarationFragment, fieldDecl); variableDeclarationFragment.resolveBinding(); } fieldDeclaration.setSourceRange(fieldDecl.declarationSourceStart, fieldDecl.declarationEnd - fieldDecl.declarationSourceStart + 1); Type type = convertType(fieldDecl.type); setTypeForField(fieldDeclaration, type, variableDeclarationFragment.getExtraDimensions()); setModifiers(fieldDeclaration, fieldDecl); convert(fieldDecl.javadoc, fieldDeclaration); return fieldDeclaration; }
protected FieldDeclaration convertToFieldDeclaration(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration fieldDecl) { VariableDeclarationFragment variableDeclarationFragment = convertToVariableDeclarationFragment(fieldDecl); final FieldDeclaration fieldDeclaration = new FieldDeclaration(this.ast); fieldDeclaration.fragments().add(variableDeclarationFragment); if (this.resolveBindings) { recordNodes(variableDeclarationFragment, fieldDecl); variableDeclarationFragment.resolveBinding(); } fieldDeclaration.setSourceRange(fieldDecl.declarationSourceStart, fieldDecl.declarationEnd - fieldDecl.declarationSourceStart + 1); Type type = convertType(fieldDecl.type); setTypeForField(fieldDeclaration, type, variableDeclarationFragment.getExtraDimensions()); setModifiers(fieldDeclaration, fieldDecl); convert(fieldDecl.javadoc, fieldDeclaration); return fieldDeclaration; }
protected FieldDeclaration convertToFieldDeclaration(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration fieldDecl) { VariableDeclarationFragment variableDeclarationFragment = convertToVariableDeclarationFragment(fieldDecl); final FieldDeclaration fieldDeclaration = new FieldDeclaration(this.ast); fieldDeclaration.fragments().add(variableDeclarationFragment); if (this.resolveBindings) { recordNodes(variableDeclarationFragment, fieldDecl); variableDeclarationFragment.resolveBinding(); } fieldDeclaration.setSourceRange(fieldDecl.declarationSourceStart, fieldDecl.declarationEnd - fieldDecl.declarationSourceStart + 1); Type type = convertType(fieldDecl.type); setTypeForField(fieldDeclaration, type, variableDeclarationFragment.getExtraDimensions()); setModifiers(fieldDeclaration, fieldDecl); convert(fieldDecl.javadoc, fieldDeclaration); return fieldDeclaration; }
protected FieldDeclaration convertToFieldDeclaration(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration fieldDecl) { VariableDeclarationFragment variableDeclarationFragment = convertToVariableDeclarationFragment(fieldDecl); final FieldDeclaration fieldDeclaration = new FieldDeclaration(this.ast); fieldDeclaration.fragments().add(variableDeclarationFragment); if (this.resolveBindings) { recordNodes(variableDeclarationFragment, fieldDecl); variableDeclarationFragment.resolveBinding(); } fieldDeclaration.setSourceRange(fieldDecl.declarationSourceStart, fieldDecl.declarationEnd - fieldDecl.declarationSourceStart + 1); Type type = convertType(fieldDecl.type); setTypeForField(fieldDeclaration, type, variableDeclarationFragment.getExtraDimensions()); setModifiers(fieldDeclaration, fieldDecl); convert(fieldDecl.javadoc, fieldDeclaration); return fieldDeclaration; }
protected FieldDeclaration convertToFieldDeclaration(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration fieldDecl) { VariableDeclarationFragment variableDeclarationFragment = convertToVariableDeclarationFragment(fieldDecl); final FieldDeclaration fieldDeclaration = new FieldDeclaration(this.ast); fieldDeclaration.fragments().add(variableDeclarationFragment); if (this.resolveBindings) { recordNodes(variableDeclarationFragment, fieldDecl); variableDeclarationFragment.resolveBinding(); } fieldDeclaration.setSourceRange(fieldDecl.declarationSourceStart, fieldDecl.declarationEnd - fieldDecl.declarationSourceStart + 1); Type type = convertType(fieldDecl.type); setTypeForField(fieldDeclaration, type, variableDeclarationFragment.getExtraDimensions()); setModifiers(fieldDeclaration, fieldDecl); convert(fieldDecl.javadoc, fieldDeclaration); return fieldDeclaration; }
ASTNode clone0(AST target) { FieldDeclaration result = new FieldDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc( (Javadoc) ASTNode.copySubtree(target, getJavadoc())); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.internalSetModifiers(getModifiers()); } if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); } result.setType((Type) getType().clone(target)); result.fragments().addAll( ASTNode.copySubtrees(target, fragments())); return result; }
ASTNode clone0(AST target) { FieldDeclaration result = new FieldDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc( (Javadoc) ASTNode.copySubtree(target, getJavadoc())); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.internalSetModifiers(getModifiers()); } if (this.ast.apiLevel >= AST.JLS3) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); } result.setType((Type) getType().clone(target)); result.fragments().addAll( ASTNode.copySubtrees(target, fragments())); return result; }
@Override ASTNode clone0(AST target) { FieldDeclaration result = new FieldDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc( (Javadoc) ASTNode.copySubtree(target, getJavadoc())); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.internalSetModifiers(getModifiers()); } if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); } result.setType((Type) getType().clone(target)); result.fragments().addAll( ASTNode.copySubtrees(target, fragments())); return result; }
ASTNode clone0(AST target) { FieldDeclaration result = new FieldDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc( (Javadoc) ASTNode.copySubtree(target, getJavadoc())); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.internalSetModifiers(getModifiers()); } if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); } result.setType((Type) getType().clone(target)); result.fragments().addAll( ASTNode.copySubtrees(target, fragments())); return result; }
ASTNode clone0(AST target) { FieldDeclaration result = new FieldDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc( (Javadoc) ASTNode.copySubtree(target, getJavadoc())); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.internalSetModifiers(getModifiers()); } if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); } result.setType((Type) getType().clone(target)); result.fragments().addAll( ASTNode.copySubtrees(target, fragments())); return result; }
ASTNode clone0(AST target) { FieldDeclaration result = new FieldDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc( (Javadoc) ASTNode.copySubtree(target, getJavadoc())); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.internalSetModifiers(getModifiers()); } if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); } result.setType((Type) getType().clone(target)); result.fragments().addAll( ASTNode.copySubtrees(target, fragments())); return result; }