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


Java BooleanLiteral类代码示例

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


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

示例1: visit

import org.eclipse.jdt.core.dom.BooleanLiteral; //导入依赖的package包/类
/**
 * checking if returnStatement is boolean, not null and has only one return
 * 
 * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ReturnStatement)
 */
@Override
public boolean visit(ReturnStatement node) {
	// one more return statement encountered.
	returnCount++;

	// examine what is being returned.
	ASTNode expression = node.getExpression();

	// if there is a return statement, it must return a boolean literal.
	if (expression == null || !(expression instanceof BooleanLiteral)) {
		this.encounteredInvalidReturnStatement = true;
	}

	return super.visit(node);
}
 
开发者ID:mdarefin,项目名称:Convert-For-Each-Loop-to-Lambda-Expression-Eclipse-Plugin,代码行数:21,代码来源:EnhancedForStatementVisitor.java

示例2: hasNonStaticFieldsWithInitializers

import org.eclipse.jdt.core.dom.BooleanLiteral; //导入依赖的package包/类
private boolean hasNonStaticFieldsWithInitializers(ASTNode node) {
	if (node instanceof TypeDeclaration) {
		TypeDeclaration td = (TypeDeclaration)node;
		for (FieldDeclaration fd : td.getFields()) {
			if (!hasStaticModifier(fd)) {
				for (Object o : fd.fragments()) {
					VariableDeclarationFragment vdf = (VariableDeclarationFragment)o;
					if (vdf.getInitializer() != null &&
						(vdf.getInitializer() instanceof BooleanLiteral ||
						 vdf.getInitializer() instanceof NumberLiteral ||
						 vdf.getInitializer() instanceof StringLiteral)) {
						return true;
					}
				}
			}
		}
		return false;
	}
	// TODO is this correct for enums?
	return false;
}
 
开发者ID:mrmonday,项目名称:j2d,代码行数:22,代码来源:J2dVisitor.java

示例3: RefinementBoolean

import org.eclipse.jdt.core.dom.BooleanLiteral; //导入依赖的package包/类
public RefinementBoolean(Expression e) {
    if (knownConstants(e))
        return;

    if (! (e instanceof BooleanLiteral)) {
        this.exists = false;
        this.value = false;
        return;
    }

    this.exists = true;
    this.value = ((BooleanLiteral) e).booleanValue();
}
 
开发者ID:capergroup,项目名称:bayou,代码行数:14,代码来源:RefinementBoolean.java

示例4: retrieveVariableReference

import org.eclipse.jdt.core.dom.BooleanLiteral; //导入依赖的package包/类
private VariableReference retrieveVariableReference(BooleanLiteral boolLiteral) {
	boolean bool = boolLiteral.booleanValue();
	PrimitiveStatement<Boolean> charAssignment = new BooleanPrimitiveStatement(
	        testCase.getReference(), bool);
	testCase.addStatement(charAssignment);
	return charAssignment.getReturnValue();
}
 
开发者ID:EvoSuite,项目名称:evosuite,代码行数:8,代码来源:TestExtractingVisitor.java

示例5: visit

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

示例6: visit

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

示例7: visit

import org.eclipse.jdt.core.dom.BooleanLiteral; //导入依赖的package包/类
@Override
public boolean visit(BooleanLiteral node) {
    if (this.badBooleanLiteral != null) {
        return false;
    }
    if (node.resolveBoxing()) { // did boxing happen? If so, that's our cue
        badBooleanLiteral = node;
        return false;
    }

    return true;
}
 
开发者ID:kjlubick,项目名称:fb-contrib-eclipse-quick-fixes,代码行数:13,代码来源:NeedlessBoxingResolution.java

示例8: booleanLiteral

import org.eclipse.jdt.core.dom.BooleanLiteral; //导入依赖的package包/类
public BooleanLiteral booleanLiteral(boolean value) {
    return ast.get().newBooleanLiteral(value);
}
 
开发者ID:opaluchlukasz,项目名称:junit2spock,代码行数:4,代码来源:ASTNodeFactory.java

示例9: endVisit

import org.eclipse.jdt.core.dom.BooleanLiteral; //导入依赖的package包/类
@Override
public void endVisit(BooleanLiteral node) {
	// Leaf node.
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:5,代码来源:FlowAnalyzer.java

示例10: endVisit

import org.eclipse.jdt.core.dom.BooleanLiteral; //导入依赖的package包/类
@Override
public void endVisit(BooleanLiteral node) {
  ITypeBinding typeBinding = node.resolveTypeBinding();
  ImmutableTypeVariable2 cv = fTCModel.makeImmutableTypeVariable(typeBinding, node);
  setConstraintVariable(node, cv);
}
 
开发者ID:eclipse,项目名称:che,代码行数:7,代码来源:InferTypeArgumentsConstraintCreator.java

示例11: visit

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

示例12: endVisit

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

示例13: visit

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

示例14: visit

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

示例15: visit

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


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