/** * @deprecated use {@link #getVariableDeclaratorId()} */ @Deprecated protected ASTVariableDeclaratorId getDecl() { return getVariableDeclaratorId(); }
@Override public JavaTypeDefinition getTypeDefinition() { return getVariableDeclaratorId().getTypeDefinition(); }
/** * Returns the type of this formal parameter. That type * is exactly that of the variable declarator id, * which means that the declarator id's type takes into * account whether this parameter is varargs or not. */ @Override public Class<?> getType() { return getVariableDeclaratorId().getType(); }
/** * Returns true if this node is the explicit receiver parameter, * e.g. in * * <pre> * class Foo { * abstract void foo(@Bar Foo this); * } * </pre> */ public boolean isExplicitReceiverParameter() { return getVariableDeclaratorId().isExplicitReceiverParameter(); }
@Override public Object visit(ASTFormalParameter node, Object data) { super.visit(node, data); JavaTypeDefinition varType = node.getVariableDeclaratorId().getTypeDefinition(); if (varType != null) { if (node.isVarargs()) { // The type of the formal parameter is defined in terms of the type // of the declarator ID node.getVariableDeclaratorId().setTypeDefinition(varType.withDimensions(1)); } } return data; }
@Override @Deprecated public int getArrayDepth() { if (!isArray()) { return 0; } return getTypeNode().getArrayDepth() + getVariableDeclaratorId().getArrayDepth() + (isVarargs() ? 1 : 0); }
/** * Returns true if this formal parameter is of an array type. * This includes varargs parameters. */ @Override @Deprecated public boolean isArray() { return isVarargs() || getTypeNode() != null && getTypeNode().isArray() || getVariableDeclaratorId().isArray(); }
/** * @deprecated use {@link #getVariableDeclaratorId()} */ @Deprecated protected ASTVariableDeclaratorId getDecl() { return getVariableDeclaratorId(); }
@Override public JavaTypeDefinition getTypeDefinition() { return getVariableDeclaratorId().getTypeDefinition(); }
/** * Returns the type of this formal parameter. That type * is exactly that of the variable declarator id, * which means that the declarator id's type takes into * account whether this parameter is varargs or not. */ @Override public Class<?> getType() { return getVariableDeclaratorId().getType(); }
/** * Returns true if this node is the explicit receiver parameter, * e.g. in * * <pre> * class Foo { * abstract void foo(@Bar Foo this); * } * </pre> */ public boolean isExplicitReceiverParameter() { return getVariableDeclaratorId().isExplicitReceiverParameter(); }
@Override public Object visit(ASTFormalParameter node, Object data) { super.visit(node, data); JavaTypeDefinition varType = node.getVariableDeclaratorId().getTypeDefinition(); if (varType != null) { if (node.isVarargs()) { // The type of the formal parameter is defined in terms of the type // of the declarator ID node.getVariableDeclaratorId().setTypeDefinition(varType.withDimensions(1)); } } return data; }
@Override @Deprecated public int getArrayDepth() { if (!isArray()) { return 0; } return getTypeNode().getArrayDepth() + getVariableDeclaratorId().getArrayDepth() + (isVarargs() ? 1 : 0); }
/** * Returns true if this formal parameter is of an array type. * This includes varargs parameters. */ @Override @Deprecated public boolean isArray() { return isVarargs() || getTypeNode() != null && getTypeNode().isArray() || getVariableDeclaratorId().isArray(); }