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


Java AssertStatement类代码示例

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


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

示例1: locationNeedsParentheses

import org.eclipse.jdt.core.dom.AssertStatement; //导入依赖的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.AssertStatement; //导入依赖的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.AssertStatement; //导入依赖的package包/类
@Override
public void endVisit(AssertStatement node) {
	if (skipNode(node)) {
		return;
	}
	IfFlowInfo info = new IfFlowInfo();
	setFlowInfo(node, info);
	info.mergeCondition(getFlowInfo(node.getExpression()), fFlowContext);
	info.merge(getFlowInfo(node.getMessage()), null, fFlowContext);
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:11,代码来源:FlowAnalyzer.java

示例4: endVisit

import org.eclipse.jdt.core.dom.AssertStatement; //导入依赖的package包/类
@Override
public void endVisit(AssertStatement node) {
	if (skipNode(node))
		return;
	IfFlowInfo info= new IfFlowInfo();
	setFlowInfo(node, info);
	info.mergeCondition(getFlowInfo(node.getExpression()), fFlowContext);
	info.merge(getFlowInfo(node.getMessage()), null, fFlowContext);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:FlowAnalyzer.java

示例5: getBooleanExpression

import org.eclipse.jdt.core.dom.AssertStatement; //导入依赖的package包/类
private static Expression getBooleanExpression(ASTNode node) {
	if (!(node instanceof Expression)) {
		return null;
	}

	// check if the node is a location where it can be negated
	StructuralPropertyDescriptor locationInParent= node.getLocationInParent();
	if (locationInParent == QualifiedName.NAME_PROPERTY) {
		node= node.getParent();
		locationInParent= node.getLocationInParent();
	}
	while (locationInParent == ParenthesizedExpression.EXPRESSION_PROPERTY) {
		node= node.getParent();
		locationInParent= node.getLocationInParent();
	}
	Expression expression= (Expression) node;
	if (!isBoolean(expression)) {
		return null;
	}
	if (expression.getParent() instanceof InfixExpression) {
		return expression;
	}
	if (locationInParent == Assignment.RIGHT_HAND_SIDE_PROPERTY || locationInParent == IfStatement.EXPRESSION_PROPERTY
			|| locationInParent == WhileStatement.EXPRESSION_PROPERTY || locationInParent == DoStatement.EXPRESSION_PROPERTY
			|| locationInParent == ReturnStatement.EXPRESSION_PROPERTY || locationInParent == ForStatement.EXPRESSION_PROPERTY
			|| locationInParent == AssertStatement.EXPRESSION_PROPERTY || locationInParent == MethodInvocation.ARGUMENTS_PROPERTY
			|| locationInParent == ConstructorInvocation.ARGUMENTS_PROPERTY || locationInParent == SuperMethodInvocation.ARGUMENTS_PROPERTY
			|| locationInParent == EnumConstantDeclaration.ARGUMENTS_PROPERTY || locationInParent == SuperConstructorInvocation.ARGUMENTS_PROPERTY
			|| locationInParent == ClassInstanceCreation.ARGUMENTS_PROPERTY || locationInParent == ConditionalExpression.EXPRESSION_PROPERTY
			|| locationInParent == PrefixExpression.OPERAND_PROPERTY) {
		return expression;
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:35,代码来源:AdvancedQuickAssistProcessor.java

示例6: visit

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

示例7: visit

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

示例8: visit

import org.eclipse.jdt.core.dom.AssertStatement; //导入依赖的package包/类
/**
 * We do not support assert.
 * 
 * 'assert' Expression [ ':' Expression ] ';'
 */
@Override
public boolean visit(final AssertStatement node)
{
  // do not visit children
  return false;
}
 
开发者ID:UBPL,项目名称:jive,代码行数:12,代码来源:StatementVisitor.java

示例9: visit

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

示例10: visit

import org.eclipse.jdt.core.dom.AssertStatement; //导入依赖的package包/类
@Override
public boolean visit(AssertStatement node) {
    asserts.add(node);

    return super.visit(node);
}
 
开发者ID:fpalomba,项目名称:aDoctor,代码行数:7,代码来源:AssertVisitor.java

示例11: endVisit

import org.eclipse.jdt.core.dom.AssertStatement; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void endVisit(AssertStatement node) {
	logger.warn("Method endVisitAssertStatement for " + node + " for " + node + " not implemented!");
	super.endVisit(node);
}
 
开发者ID:EvoSuite,项目名称:evosuite,代码行数:7,代码来源:LoggingVisitor.java

示例12: visit

import org.eclipse.jdt.core.dom.AssertStatement; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean visit(AssertStatement node) {
	logger.warn("Method visitAssertStatement for " + node + " for " + node + " not implemented!");
	return super.visit(node);
}
 
开发者ID:EvoSuite,项目名称:evosuite,代码行数:7,代码来源:LoggingVisitor.java

示例13: visit

import org.eclipse.jdt.core.dom.AssertStatement; //导入依赖的package包/类
@Override
public boolean visit(final AssertStatement node) {
	return false;
}
 
开发者ID:Beagle-PSE,项目名称:Beagle,代码行数:5,代码来源:NotRecursingAstVisitor.java

示例14: visit

import org.eclipse.jdt.core.dom.AssertStatement; //导入依赖的package包/类
@Override
public boolean visit(final AssertStatement node) {
	return this.visitInstrumentable(node);
}
 
开发者ID:Beagle-PSE,项目名称:Beagle,代码行数:5,代码来源:InstrumentableAstNodeLister.java

示例15: visit

import org.eclipse.jdt.core.dom.AssertStatement; //导入依赖的package包/类
@Override
public boolean visit(AssertStatement node) {
	if (node.subtreeMatch(fMatcher, fNodeToMatch))
		return matches(node);
	return super.visit(node);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:AstMatchingNodeFinder.java


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