final int internalGetSetIntProperty(SimplePropertyDescriptor property, boolean get, int value) { if (property == EXTRA_DIMENSIONS_PROPERTY) { if (get) { return getExtraDimensions(); } else { internalSetExtraDimensions(value); return 0; } } // allow default implementation to flag the error return super.internalGetSetIntProperty(property, get, value); }
final int internalGetSetIntProperty(SimplePropertyDescriptor property, boolean get, int value) { if (property == EXTRA_DIMENSIONS_PROPERTY) { if (get) { return getExtraDimensions(); } else { internalSetExtraDimensions(value); return 0; } } // allow default implementation to flag the error return super.internalGetSetIntProperty(property, get, value); }
final int internalGetSetIntProperty(SimplePropertyDescriptor property, boolean get, int value) { if (property == EXTRA_DIMENSIONS_PROPERTY) { if (get) { return getExtraDimensions(); } else { internalSetExtraDimensions(value); return 0; } } // allow default implementation to flag the error return super.internalGetSetIntProperty(property, get, value); }
final int internalGetSetIntProperty(SimplePropertyDescriptor property, boolean get, int value) { if (property == EXTRA_DIMENSIONS_PROPERTY) { if (get) { return getExtraDimensions(); } else { setExtraDimensions(value); return 0; } } // allow default implementation to flag the error return super.internalGetSetIntProperty(property, get, value); }
final int internalGetSetIntProperty(SimplePropertyDescriptor property, boolean get, int value) { if (property == EXTRA_DIMENSIONS_PROPERTY) { if (get) { return getExtraDimensions(); } else { internalSetExtraDimensions(value); return 0; } } // allow default implementation to flag the error return super.internalGetSetIntProperty(property, get, value); }
@Override final int internalGetSetIntProperty(SimplePropertyDescriptor property, boolean get, int value) { if (property == EXTRA_DIMENSIONS_PROPERTY) { if (get) { return getExtraDimensions(); } else { internalSetExtraDimensions(value); return 0; } } // allow default implementation to flag the error return super.internalGetSetIntProperty(property, get, value); }
public boolean hasDimensions(final VariableDeclarationFragment fragment) { boolean _java8orHigher = this.java8orHigher(); if (_java8orHigher) { List<ASTNode> dimensions = this._aSTFlattenerUtils.genericChildListProperty(fragment, "extraDimensions2"); boolean _isNullOrEmpty = IterableExtensions.isNullOrEmpty(dimensions); return (!_isNullOrEmpty); } else { int _extraDimensions = fragment.getExtraDimensions(); return (_extraDimensions > 0); } }
public boolean visit(VariableDeclarationFragment node) { node.getName().accept(this); for (int i = 0; i < node.getExtraDimensions(); i++) { this.buffer.append("[]");//$NON-NLS-1$ } if (node.getInitializer() != null) { this.buffer.append("=");//$NON-NLS-1$ node.getInitializer().accept(this); } return false; }
public boolean visit(VariableDeclarationFragment node) { node.getName().accept(this); for (int i= 0; i < node.getExtraDimensions(); i++) { this.fBuffer.append("[]");//$NON-NLS-1$ } if (node.getInitializer() != null) { this.fBuffer.append("=");//$NON-NLS-1$ node.getInitializer().accept(this); } return false; }
private CSField mapFieldDeclarationFragment(FieldDeclaration node, VariableDeclarationFragment fragment, CSTypeReferenceExpression fieldType, CSVisibility fieldVisibility) { if (fragment.getExtraDimensions() > 0) { fieldType = new CSArrayTypeReference(fieldType, fragment.getExtraDimensions()); } CSField field = new CSField(fieldName(fragment), fieldType, fieldVisibility, mapFieldInitializer(fragment)); if (isConstField(node, fragment)) { field.addModifier(CSFieldModifier.Const); } else { processFieldModifiers(field, node.getModifiers()); } mapAnnotations(node, field); mapDocumentation(node, field); return field; }
protected VariableDeclarationExpression convertToVariableDeclarationExpression(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration localDeclaration) { final VariableDeclarationFragment variableDeclarationFragment = convertToVariableDeclarationFragment(localDeclaration); final VariableDeclarationExpression variableDeclarationExpression = new VariableDeclarationExpression(this.ast); variableDeclarationExpression.fragments().add(variableDeclarationFragment); if (this.resolveBindings) { recordNodes(variableDeclarationFragment, localDeclaration); } variableDeclarationExpression.setSourceRange(localDeclaration.declarationSourceStart, localDeclaration.declarationSourceEnd - localDeclaration.declarationSourceStart + 1); Type type = convertType(localDeclaration.type); setTypeForVariableDeclarationExpression(variableDeclarationExpression, type, variableDeclarationFragment.getExtraDimensions()); if (localDeclaration.modifiersSourceStart != -1) { setModifiers(variableDeclarationExpression, localDeclaration); } return variableDeclarationExpression; }
protected VariableDeclarationExpression convertToVariableDeclarationExpression(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration localDeclaration) { final VariableDeclarationFragment variableDeclarationFragment = convertToVariableDeclarationFragment(localDeclaration); final VariableDeclarationExpression variableDeclarationExpression = new VariableDeclarationExpression(this.ast); variableDeclarationExpression.fragments().add(variableDeclarationFragment); if (this.resolveBindings) { recordNodes(variableDeclarationFragment, localDeclaration); } variableDeclarationExpression.setSourceRange(localDeclaration.declarationSourceStart, localDeclaration.declarationSourceEnd - localDeclaration.declarationSourceStart + 1); Type type = convertType(localDeclaration.type); setTypeForVariableDeclarationExpression(variableDeclarationExpression, type, variableDeclarationFragment.getExtraDimensions()); if (localDeclaration.modifiersSourceStart != -1) { setModifiers(variableDeclarationExpression, localDeclaration); } return variableDeclarationExpression; }
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; }
public boolean visit(VariableDeclarationFragment node) { IValue name = values.string(node.getName().getFullyQualifiedName()); IValue initializer = node.getInitializer() == null ? null : visitChild(node.getInitializer()); ownValue = constructExpressionNode("variable", name, values.integer(node.getExtraDimensions()), initializer); return false; }
ASTNode clone0(AST target) { VariableDeclarationFragment result = new VariableDeclarationFragment(target); result.setSourceRange(getStartPosition(), getLength()); result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS8_INTERNAL) { result.extraDimensions().addAll( ASTNode.copySubtrees(target, extraDimensions())); } else { result.internalSetExtraDimensions(getExtraDimensions()); } result.setInitializer( (Expression) ASTNode.copySubtree(target, getInitializer())); return result; }
ASTNode clone0(AST target) { VariableDeclarationFragment result = new VariableDeclarationFragment(target); result.setSourceRange(getStartPosition(), getLength()); result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS8) { result.extraDimensions().addAll( ASTNode.copySubtrees(target, extraDimensions())); } else { result.internalSetExtraDimensions(getExtraDimensions()); } result.setInitializer( (Expression) ASTNode.copySubtree(target, getInitializer())); return result; }
ASTNode clone0(AST target) { VariableDeclarationFragment result = new VariableDeclarationFragment(target); result.setSourceRange(getStartPosition(), getLength()); result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS8) { result.extraDimensions().addAll( ASTNode.copySubtrees(target, extraDimensions())); } else { result.internalSetExtraDimensions(getExtraDimensions()); } result.setInitializer( (Expression) ASTNode.copySubtree(target, getInitializer())); return result; }
@Override ASTNode clone0(AST target) { VariableDeclarationFragment result = new VariableDeclarationFragment(target); result.setSourceRange(getStartPosition(), getLength()); result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS8_INTERNAL) { result.extraDimensions().addAll( ASTNode.copySubtrees(target, extraDimensions())); } else { result.internalSetExtraDimensions(getExtraDimensions()); } result.setInitializer( (Expression) ASTNode.copySubtree(target, getInitializer())); return result; }
ASTNode clone0(AST target) { VariableDeclarationFragment result = new VariableDeclarationFragment(target); result.setSourceRange(getStartPosition(), getLength()); result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS8) { result.extraDimensions().addAll( ASTNode.copySubtrees(target, extraDimensions())); } else { result.internalSetExtraDimensions(getExtraDimensions()); } result.setInitializer( (Expression) ASTNode.copySubtree(target, getInitializer())); return result; }
ASTNode clone0(AST target) { VariableDeclarationFragment result = new VariableDeclarationFragment(target); result.setSourceRange(getStartPosition(), getLength()); result.setName((SimpleName) getName().clone(target)); result.setExtraDimensions(getExtraDimensions()); result.setInitializer( (Expression) ASTNode.copySubtree(target, getInitializer())); return result; }