Example usage for org.eclipse.jdt.core.dom BooleanLiteral BooleanLiteral

List of usage examples for org.eclipse.jdt.core.dom BooleanLiteral BooleanLiteral

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom BooleanLiteral BooleanLiteral.

Prototype

BooleanLiteral(AST ast) 

Source Link

Document

Creates a new unparented boolean literal node owned by the given AST.

Usage

From source file:org.eclipse.jdt.core.dom.ASTConverter.java

License:Open Source License

public BooleanLiteral convert(org.eclipse.jdt.internal.compiler.ast.FalseLiteral expression) {
    final BooleanLiteral literal = new BooleanLiteral(this.ast);
    literal.setBooleanValue(false);/*from ww  w  . j a v  a  2 s .c o  m*/
    if (this.resolveBindings) {
        this.recordNodes(literal, expression);
    }
    literal.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1);
    return literal;
}

From source file:org.eclipse.jdt.core.dom.ASTConverter.java

License:Open Source License

public BooleanLiteral convert(org.eclipse.jdt.internal.compiler.ast.TrueLiteral expression) {
    final BooleanLiteral literal = new BooleanLiteral(this.ast);
    literal.setBooleanValue(true);/*from w  ww.j  a v  a  2s  . c  om*/
    if (this.resolveBindings) {
        this.recordNodes(literal, expression);
    }
    literal.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1);
    return literal;
}