本文整理匯總了Java中org.eclipse.jdt.core.dom.SingleVariableDeclaration.getParent方法的典型用法代碼示例。如果您正苦於以下問題:Java SingleVariableDeclaration.getParent方法的具體用法?Java SingleVariableDeclaration.getParent怎麽用?Java SingleVariableDeclaration.getParent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jdt.core.dom.SingleVariableDeclaration
的用法示例。
在下文中一共展示了SingleVariableDeclaration.getParent方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: removeParamTag
import org.eclipse.jdt.core.dom.SingleVariableDeclaration; //導入方法依賴的package包/類
private void removeParamTag(
ASTRewrite rewrite, SingleVariableDeclaration varDecl, TextEditGroup group) {
if (varDecl.getParent() instanceof MethodDeclaration) {
Javadoc javadoc = ((MethodDeclaration) varDecl.getParent()).getJavadoc();
if (javadoc != null) {
TagElement tagElement =
JavadocTagsSubProcessor.findParamTag(javadoc, varDecl.getName().getIdentifier());
if (tagElement != null) {
rewrite.remove(tagElement, group);
}
}
}
}
示例2: removeParamTag
import org.eclipse.jdt.core.dom.SingleVariableDeclaration; //導入方法依賴的package包/類
private void removeParamTag(ASTRewrite rewrite, SingleVariableDeclaration varDecl) {
if (varDecl.getParent() instanceof MethodDeclaration) {
Javadoc javadoc = ((MethodDeclaration) varDecl.getParent()).getJavadoc();
if (javadoc != null) {
TagElement tagElement =
JavadocTagsSubProcessor.findParamTag(javadoc, varDecl.getName().getIdentifier());
if (tagElement != null) {
rewrite.remove(tagElement, null);
}
}
}
}
示例3: visit
import org.eclipse.jdt.core.dom.SingleVariableDeclaration; //導入方法依賴的package包/類
@Override
public boolean visit(SingleVariableDeclaration node) {
if(node.getParent() instanceof MethodDeclaration)
params.add(node.resolveBinding().getType().getQualifiedName());
return true;
}
示例4: getFormalParameterNumber
import org.eclipse.jdt.core.dom.SingleVariableDeclaration; //導入方法依賴的package包/類
/**
* Returns to formal parameter number of svd starting from zero.
*
* @param svd
* The formal parameter.
* @return The formal parameter number starting at zero.
*/
private static int getFormalParameterNumber(SingleVariableDeclaration svd) {
final MethodDeclaration decl = (MethodDeclaration) svd.getParent();
return decl.parameters().indexOf(svd);
}