@Override public boolean isVarArgs() { return param.isVarargs(); }
final boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean get, boolean value) { if (property == VARARGS_PROPERTY) { if (get) { return isVarargs(); } else { setVarargs(value); return false; } } // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); }
final boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean get, boolean value) { if (property == VARARGS_PROPERTY) { if (get) { return isVarargs(); } else { setVarargs(value); return false; } } // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); }
final boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean get, boolean value) { if (property == VARARGS_PROPERTY) { if (get) { return isVarargs(); } else { setVarargs(value); return false; } } // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); }
final boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean get, boolean value) { if (property == VARARGS_PROPERTY) { if (get) { return isVarargs(); } else { setVarargs(value); return false; } } // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); }
final boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean get, boolean value) { if (property == VARARGS_PROPERTY) { if (get) { return isVarargs(); } else { setVarargs(value); return false; } } // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); }
@Override final boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean get, boolean value) { if (property == VARARGS_PROPERTY) { if (get) { return isVarargs(); } else { setVarargs(value); return false; } } // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); }
private String getSignature(MethodDeclaration node) { StringBuffer buffer= new StringBuffer(); buffer.append(node.getName().toString()); buffer.append('('); boolean first= true; Iterator<SingleVariableDeclaration> iterator= node.parameters().iterator(); while (iterator.hasNext()) { SingleVariableDeclaration svd= iterator.next(); if (!first) buffer.append(", "); //$NON-NLS-1$ buffer.append(getType(svd.getType())); if (svd.isVarargs()) buffer.append("..."); //$NON-NLS-1$ first= false; } buffer.append(')'); return buffer.toString(); }
private String getSignature(MethodDeclaration node) { StringBuilder buffer= new StringBuilder(); buffer.append(node.getName().toString()); buffer.append('('); boolean first= true; Iterator<SingleVariableDeclaration> iterator= node.parameters().iterator(); while (iterator.hasNext()) { SingleVariableDeclaration svd= iterator.next(); if (!first) buffer.append(", "); //$NON-NLS-1$ buffer.append(getType(svd.getType())); if (svd.isVarargs()) buffer.append("..."); //$NON-NLS-1$ first= false; } buffer.append(')'); return buffer.toString(); }
@Override public void endVisit(SingleVariableDeclaration node) { // this must be endVisit in case a space added by a visit on a child node needs to be cleared if (node.isVarargs()) { handleTokenBefore(node.getName(), TokenNameELLIPSIS, this.options.insert_space_before_ellipsis, this.options.insert_space_after_ellipsis); List<Annotation> varargsAnnotations = node.varargsAnnotations(); if (!varargsAnnotations.isEmpty()) { this.tm.firstTokenIn(varargsAnnotations.get(0), TokenNameAT).spaceBefore(); this.tm.lastTokenIn(varargsAnnotations.get(varargsAnnotations.size() - 1), -1).clearSpaceAfter(); } } else { handleToken(node.getName(), TokenNameIdentifier, true, false); } }
@Override public void endVisit(SingleVariableDeclaration node) { // this must be endVisit in case a space added by a visit on a child node needs to be cleared if (node.isVarargs()) { handleTokenBefore(node.getName(), TokenNameELLIPSIS, this.options.insert_space_before_ellipsis, this.options.insert_space_after_ellipsis); List<Annotation> varargsAnnotations = node.varargsAnnotations(); if (!varargsAnnotations.isEmpty()) { this.tm.firstTokenIn(varargsAnnotations.get(0), TokenNameAT).spaceBefore(); this.tm.lastTokenIn(varargsAnnotations.get(varargsAnnotations.size() - 1), -1).clearSpaceAfter(); } } else { handleToken(node.getName(), TokenNameIdentifier, true, false); } }
@Override public void endVisit(SingleVariableDeclaration node) { // this must be endVisit in case a space added by a visit on a child node needs to be cleared if (node.isVarargs()) { handleTokenBefore(node.getName(), TokenNameELLIPSIS, this.options.insert_space_before_ellipsis, this.options.insert_space_after_ellipsis); List<Annotation> varargsAnnotations = node.varargsAnnotations(); if (!varargsAnnotations.isEmpty()) { this.tm.firstTokenIn(varargsAnnotations.get(0), TokenNameAT).spaceBefore(); this.tm.lastTokenIn(varargsAnnotations.get(varargsAnnotations.size() - 1), -1).clearSpaceAfter(); } } else { handleToken(node.getName(), TokenNameIdentifier, true, false); } }
@Override public void endVisit(SingleVariableDeclaration node) { // this must be endVisit in case a space added by a visit on a child node needs to be cleared if (node.isVarargs()) { handleTokenBefore(node.getName(), TokenNameELLIPSIS, this.options.insert_space_before_ellipsis, this.options.insert_space_after_ellipsis); List<Annotation> varargsAnnotations = node.varargsAnnotations(); if (!varargsAnnotations.isEmpty()) { this.tm.firstTokenIn(varargsAnnotations.get(0), TokenNameAT).spaceBefore(); this.tm.lastTokenIn(varargsAnnotations.get(varargsAnnotations.size() - 1), -1).clearSpaceAfter(); } } else { handleToken(node.getName(), TokenNameIdentifier, true, false); } }
public static void extractParametersAndReturnType(MethodDeclaration methodDeclaration, SDMethod method) { Type returnType = methodDeclaration.getReturnType2(); if (returnType != null) { method.setReturnType(AstUtils.normalizeTypeName(returnType, methodDeclaration.getExtraDimensions(), false)); } else { method.setReturnType(null); } Iterator<SingleVariableDeclaration> parameters = methodDeclaration.parameters().iterator(); while (parameters.hasNext()) { SingleVariableDeclaration parameter = parameters.next(); Type parameterType = parameter.getType(); String typeName = AstUtils.normalizeTypeName(parameterType, parameter.getExtraDimensions(), parameter.isVarargs()); method.addParameter(parameter.getName().getIdentifier(), typeName); } }
@Override void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { acceptChildren(visitor, this.modifiers); } acceptChild(visitor, getType()); if (this.ast.apiLevel >= AST.JLS8_INTERNAL && isVarargs()) { acceptChildren(visitor, this.varargsAnnotations); } acceptChild(visitor, getName()); if (this.ast.apiLevel >= AST.JLS8_INTERNAL){ acceptChildren(visitor, this.extraDimensions); } acceptChild(visitor, getInitializer()); } visitor.endVisit(this); }
void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { acceptChildren(visitor, this.modifiers); } acceptChild(visitor, getType()); if (this.ast.apiLevel >= AST.JLS8_INTERNAL && isVarargs()) { acceptChildren(visitor, this.varargsAnnotations); } acceptChild(visitor, getName()); if (this.ast.apiLevel >= AST.JLS8_INTERNAL){ acceptChildren(visitor, this.extraDimensions); } acceptChild(visitor, getInitializer()); } visitor.endVisit(this); }
void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { acceptChildren(visitor, this.modifiers); } acceptChild(visitor, getType()); if (this.ast.apiLevel >= AST.JLS8 && isVarargs()) { acceptChildren(visitor, this.varargsAnnotations); } acceptChild(visitor, getName()); if (this.ast.apiLevel >= AST.JLS8){ acceptChildren(visitor, this.extraDimensions); } acceptChild(visitor, getInitializer()); } visitor.endVisit(this); }
void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { acceptChildren(visitor, this.modifiers); } acceptChild(visitor, getType()); if (this.ast.apiLevel >= AST.JLS8 && isVarargs()) { acceptChildren(visitor, this.varargsAnnotations); } acceptChild(visitor, getName()); if (this.ast.apiLevel >= AST.JLS8){ acceptChildren(visitor, this.extraDimensions); } acceptChild(visitor, getInitializer()); } visitor.endVisit(this); }
public boolean visit(SingleVariableDeclaration node) { IValue name = values.string(node.getName().getFullyQualifiedName()); IValueList extendedModifiers = parseExtendedModifiers(node.modifiers()); IValue type = visitChild(node.getType()); IValue initializer = node.getInitializer() == null ? null : visitChild(node.getInitializer()); ownValue = constructDeclarationNode("parameter", type, name, values.integer(node.getExtraDimensions()), initializer); if (node.getAST().apiLevel() >= AST.JLS3 && node.isVarargs()) ownValue = constructDeclarationNode("vararg", type, name); setKeywordParameters("modifiers", extendedModifiers); return false; }
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; }