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


Java SynchronizedStatement类代码示例

本文整理汇总了Java中org.eclipse.jdt.core.dom.SynchronizedStatement的典型用法代码示例。如果您正苦于以下问题:Java SynchronizedStatement类的具体用法?Java SynchronizedStatement怎么用?Java SynchronizedStatement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SynchronizedStatement类属于org.eclipse.jdt.core.dom包,在下文中一共展示了SynchronizedStatement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: locationNeedsParentheses

import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
private static boolean locationNeedsParentheses(StructuralPropertyDescriptor locationInParent) {
	if (locationInParent instanceof ChildListPropertyDescriptor && locationInParent != InfixExpression.EXTENDED_OPERANDS_PROPERTY) {
		// e.g. argument lists of MethodInvocation, ClassInstanceCreation, dimensions of ArrayCreation ...
		return false;
	}
	if (locationInParent == VariableDeclarationFragment.INITIALIZER_PROPERTY
			|| locationInParent == SingleVariableDeclaration.INITIALIZER_PROPERTY
			|| locationInParent == ReturnStatement.EXPRESSION_PROPERTY
			|| locationInParent == EnhancedForStatement.EXPRESSION_PROPERTY
			|| locationInParent == ForStatement.EXPRESSION_PROPERTY
			|| locationInParent == WhileStatement.EXPRESSION_PROPERTY
			|| locationInParent == DoStatement.EXPRESSION_PROPERTY
			|| locationInParent == AssertStatement.EXPRESSION_PROPERTY
			|| locationInParent == AssertStatement.MESSAGE_PROPERTY
			|| locationInParent == IfStatement.EXPRESSION_PROPERTY
			|| locationInParent == SwitchStatement.EXPRESSION_PROPERTY
			|| locationInParent == SwitchCase.EXPRESSION_PROPERTY
			|| locationInParent == ArrayAccess.INDEX_PROPERTY
			|| locationInParent == ThrowStatement.EXPRESSION_PROPERTY
			|| locationInParent == SynchronizedStatement.EXPRESSION_PROPERTY
			|| locationInParent == ParenthesizedExpression.EXPRESSION_PROPERTY) {
		return false;
	}
	return true;
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:26,代码来源:NecessaryParenthesesChecker.java

示例2: locationNeedsParentheses

import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
private static boolean locationNeedsParentheses(StructuralPropertyDescriptor locationInParent) {
  if (locationInParent instanceof ChildListPropertyDescriptor
      && locationInParent != InfixExpression.EXTENDED_OPERANDS_PROPERTY) {
    // e.g. argument lists of MethodInvocation, ClassInstanceCreation, dimensions of ArrayCreation
    // ...
    return false;
  }
  if (locationInParent == VariableDeclarationFragment.INITIALIZER_PROPERTY
      || locationInParent == SingleVariableDeclaration.INITIALIZER_PROPERTY
      || locationInParent == ReturnStatement.EXPRESSION_PROPERTY
      || locationInParent == EnhancedForStatement.EXPRESSION_PROPERTY
      || locationInParent == ForStatement.EXPRESSION_PROPERTY
      || locationInParent == WhileStatement.EXPRESSION_PROPERTY
      || locationInParent == DoStatement.EXPRESSION_PROPERTY
      || locationInParent == AssertStatement.EXPRESSION_PROPERTY
      || locationInParent == AssertStatement.MESSAGE_PROPERTY
      || locationInParent == IfStatement.EXPRESSION_PROPERTY
      || locationInParent == SwitchStatement.EXPRESSION_PROPERTY
      || locationInParent == SwitchCase.EXPRESSION_PROPERTY
      || locationInParent == ArrayAccess.INDEX_PROPERTY
      || locationInParent == ThrowStatement.EXPRESSION_PROPERTY
      || locationInParent == SynchronizedStatement.EXPRESSION_PROPERTY
      || locationInParent == ParenthesizedExpression.EXPRESSION_PROPERTY) {
    return false;
  }
  return true;
}
 
开发者ID:eclipse,项目名称:che,代码行数:28,代码来源:NecessaryParenthesesChecker.java

示例3: endVisit

import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
@Override
public void endVisit(SynchronizedStatement node) {
	if (skipNode(node)) {
		return;
	}
	GenericSequentialFlowInfo info = processSequential(node, node.getExpression());
	process(info, node.getBody());
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:9,代码来源:FlowAnalyzer.java

示例4: endVisit

import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
@Override
public void endVisit(SynchronizedStatement node) {
	ASTNode firstSelectedNode = getFirstSelectedNode();
	if (getSelection().getEndVisitSelectionMode(node) == Selection.SELECTED) {
		if (firstSelectedNode == node.getBody()) {
			invalidSelection(RefactoringCoreMessages.StatementAnalyzer_synchronized_statement);
		}
	}
	super.endVisit(node);
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:11,代码来源:StatementAnalyzer.java

示例5: createResultVisitor

import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
@Override
protected ResultVisitor createResultVisitor() 
{
	return new ResultVisitor() {
		@Override
		public boolean visit(final SynchronizedStatement node) {
			setMatch(true); //synchronized statement gefunden
			setMatchedNode(node);
			return true;
		}		
	};
}
 
开发者ID:Ragnaroek,项目名称:eclipse-astparser,代码行数:13,代码来源:Synchronized.java

示例6: endVisit

import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
@Override
public void endVisit(SynchronizedStatement node) {
  ASTNode firstSelectedNode = getFirstSelectedNode();
  if (getSelection().getEndVisitSelectionMode(node) == Selection.SELECTED) {
    if (firstSelectedNode == node.getBody()) {
      invalidSelection(RefactoringCoreMessages.StatementAnalyzer_synchronized_statement);
    }
  }
  super.endVisit(node);
}
 
开发者ID:eclipse,项目名称:che,代码行数:11,代码来源:StatementAnalyzer.java

示例7: visit

import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
/**
 * We don't really need anything in particular from this statement,
 * but since it has an expression and a body, we only want to 
 * investigate the expression part to determine if it needs to
 * be in the slice.
 */
public boolean visit(SynchronizedStatement node){
	if(this.options.contains(Slicer.Options.CONTROL_EXPRESSIONS_ONLY)){
		/* Visit the expression part. */
		node.getExpression().accept(this);
		/* Don't visit the children. */
		return false;
	}
	else return true;
}
 
开发者ID:qhanam,项目名称:Slicer,代码行数:16,代码来源:FDDSeedVisitor.java

示例8: visit

import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
/**
 * We want to track the variables from the expression only.
 */
public boolean visit(SynchronizedStatement node){
	/* Visit the expression part. */
	node.getExpression().accept(this);
	/* Don't visit the children. */
	return false;	
}
 
开发者ID:qhanam,项目名称:Slicer,代码行数:10,代码来源:FDDVisitor.java

示例9: endVisit

import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
@Override
public void endVisit(SynchronizedStatement node) {
	if (skipNode(node))
		return;
	GenericSequentialFlowInfo info= processSequential(node, node.getExpression());
	process(info, node.getBody());
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:FlowAnalyzer.java

示例10: endVisit

import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
@Override
public void endVisit(SynchronizedStatement node) {
	ASTNode firstSelectedNode= getFirstSelectedNode();
	if (getSelection().getEndVisitSelectionMode(node) == Selection.SELECTED) {
		if (firstSelectedNode == node.getBody()) {
			invalidSelection(RefactoringCoreMessages.StatementAnalyzer_synchronized_statement);
		}
	}
	super.endVisit(node);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:StatementAnalyzer.java

示例11: visit

import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
@Override
public boolean visit(SynchronizedStatement node) {
	this.fBuffer.append("synchronized (");//$NON-NLS-1$
	node.getExpression().accept(this);
	this.fBuffer.append(") ");//$NON-NLS-1$
	node.getBody().accept(this);
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:9,代码来源:ASTFlattener.java

示例12: visit

import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
public boolean visit(SynchronizedStatement node) {
	this.buffer.append("synchronized (");//$NON-NLS-1$
	node.getExpression().accept(this);
	this.buffer.append(") ");//$NON-NLS-1$
	node.getBody().accept(this);
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:8,代码来源:NaiveASTFlattener.java

示例13: visit

import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
/**
 * 'synchronized' '(' Expression ')' Block
 */
@Override
public boolean visit(final SynchronizedStatement node)
{
  visitControlNode(LK_SYNCHRONIZED, lineStart(node), node.getExpression(), node.getBody());
  // do not visit children
  return false;
}
 
开发者ID:UBPL,项目名称:jive,代码行数:11,代码来源:StatementVisitor.java

示例14: visit

import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
@Override
public boolean visit(SynchronizedStatement node) {
	//System.out.println("Found: " + node.getClass());
	print("synchronized (");
	node.getExpression().accept(this);
	println(") {");
	indent++;
	node.getBody().accept(this);
	indent--;
	println("}");
	return false;
}
 
开发者ID:mrmonday,项目名称:j2d,代码行数:13,代码来源:J2dVisitor.java

示例15: DOMSynchronizedStatement

import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
public DOMSynchronizedStatement(SynchronizedStatement statement) {
    this.statement = statement;
}
 
开发者ID:capergroup,项目名称:bayou,代码行数:4,代码来源:DOMSynchronizedStatement.java


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