本文整理汇总了Java中org.eclipse.jdt.core.dom.LabeledStatement.getLabel方法的典型用法代码示例。如果您正苦于以下问题:Java LabeledStatement.getLabel方法的具体用法?Java LabeledStatement.getLabel怎么用?Java LabeledStatement.getLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.dom.LabeledStatement
的用法示例。
在下文中一共展示了LabeledStatement.getLabel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getParentLoopBody
import org.eclipse.jdt.core.dom.LabeledStatement; //导入方法依赖的package包/类
private Statement getParentLoopBody(ASTNode node) {
Statement stmt = null;
ASTNode start = node;
while (start != null && !(start instanceof ForStatement) && !(start instanceof DoStatement) && !(start instanceof WhileStatement) && !(start instanceof EnhancedForStatement) && !(start instanceof SwitchStatement)) {
start = start.getParent();
}
if (start instanceof ForStatement) {
stmt = ((ForStatement) start).getBody();
} else if (start instanceof DoStatement) {
stmt = ((DoStatement) start).getBody();
} else if (start instanceof WhileStatement) {
stmt = ((WhileStatement) start).getBody();
} else if (start instanceof EnhancedForStatement) {
stmt = ((EnhancedForStatement) start).getBody();
}
if (start != null && start.getParent() instanceof LabeledStatement) {
LabeledStatement labeledStatement = (LabeledStatement) start.getParent();
fEnclosingLoopLabel = labeledStatement.getLabel();
}
return stmt;
}
示例2: getParentLoopBody
import org.eclipse.jdt.core.dom.LabeledStatement; //导入方法依赖的package包/类
private Statement getParentLoopBody(ASTNode node) {
Statement stmt = null;
ASTNode start = node;
while (start != null
&& !(start instanceof ForStatement)
&& !(start instanceof DoStatement)
&& !(start instanceof WhileStatement)
&& !(start instanceof EnhancedForStatement)
&& !(start instanceof SwitchStatement)) {
start = start.getParent();
}
if (start instanceof ForStatement) {
stmt = ((ForStatement) start).getBody();
} else if (start instanceof DoStatement) {
stmt = ((DoStatement) start).getBody();
} else if (start instanceof WhileStatement) {
stmt = ((WhileStatement) start).getBody();
} else if (start instanceof EnhancedForStatement) {
stmt = ((EnhancedForStatement) start).getBody();
}
if (start != null && start.getParent() instanceof LabeledStatement) {
LabeledStatement labeledStatement = (LabeledStatement) start.getParent();
fEnclosingLoopLabel = labeledStatement.getLabel();
}
return stmt;
}
示例3: getParentLoopBody
import org.eclipse.jdt.core.dom.LabeledStatement; //导入方法依赖的package包/类
private Statement getParentLoopBody(ASTNode node) {
Statement stmt= null;
ASTNode start= node;
while (start != null
&& !(start instanceof ForStatement)
&& !(start instanceof DoStatement)
&& !(start instanceof WhileStatement)
&& !(start instanceof EnhancedForStatement)
&& !(start instanceof SwitchStatement)) {
start= start.getParent();
}
if (start instanceof ForStatement) {
stmt= ((ForStatement)start).getBody();
} else if (start instanceof DoStatement) {
stmt= ((DoStatement)start).getBody();
} else if (start instanceof WhileStatement) {
stmt= ((WhileStatement)start).getBody();
} else if (start instanceof EnhancedForStatement) {
stmt= ((EnhancedForStatement)start).getBody();
}
if (start != null && start.getParent() instanceof LabeledStatement) {
LabeledStatement labeledStatement= (LabeledStatement)start.getParent();
fEnclosingLoopLabel= labeledStatement.getLabel();
}
return stmt;
}
示例4: visit
import org.eclipse.jdt.core.dom.LabeledStatement; //导入方法依赖的package包/类
@Override
public boolean visit(LabeledStatement node) {
if (fDefiningLabel == null) {
SimpleName label= node.getLabel();
if (fLabel == label || isSameLabel(label) && ASTNodes.isParent(fLabel, node)) {
fDefiningLabel= node;
fResult.add(label);
}
}
node.getBody().accept(this);
return false;
}
示例5: visit
import org.eclipse.jdt.core.dom.LabeledStatement; //导入方法依赖的package包/类
@Override
public boolean visit(LabeledStatement node) {
if (fDefiningLabel == null) {
SimpleName label = node.getLabel();
if (fLabel == label || isSameLabel(label) && ASTNodes.isParent(fLabel, node)) {
fDefiningLabel = node;
fResult.add(label);
}
}
node.getBody().accept(this);
return false;
}
示例6: visit
import org.eclipse.jdt.core.dom.LabeledStatement; //导入方法依赖的package包/类
@Override
public boolean visit(LabeledStatement node) {
SimpleName sn = node.getLabel();
addNewBinding(sn.resolveBinding(), node);
return true;
}