本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例10: visit
import org.eclipse.jdt.core.dom.AssertStatement; //导入依赖的package包/类
@Override
public boolean visit(AssertStatement node) {
asserts.add(node);
return super.visit(node);
}
示例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);
}
示例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);
}
示例13: visit
import org.eclipse.jdt.core.dom.AssertStatement; //导入依赖的package包/类
@Override
public boolean visit(final AssertStatement node) {
return false;
}
示例14: visit
import org.eclipse.jdt.core.dom.AssertStatement; //导入依赖的package包/类
@Override
public boolean visit(final AssertStatement node) {
return this.visitInstrumentable(node);
}
示例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);
}