当前位置: 首页>>代码示例>>Java>>正文


Java LabeledStatement.getLabel方法代码示例

本文整理汇总了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;
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:22,代码来源:ExtractMethodAnalyzer.java

示例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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:ExtractMethodAnalyzer.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:ExtractMethodAnalyzer.java

示例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;
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:13,代码来源:LinkedNodeFinder.java

示例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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:13,代码来源:LinkedNodeFinder.java

示例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;
}
 
开发者ID:aroog,项目名称:code,代码行数:7,代码来源:WorkspaceUtilities.java


注:本文中的org.eclipse.jdt.core.dom.LabeledStatement.getLabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。