本文整理汇总了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;
}
示例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;
}
示例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());
}
示例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);
}
示例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;
}
};
}
示例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);
}
示例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;
}
示例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;
}
示例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());
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例15: DOMSynchronizedStatement
import org.eclipse.jdt.core.dom.SynchronizedStatement; //导入依赖的package包/类
public DOMSynchronizedStatement(SynchronizedStatement statement) {
this.statement = statement;
}