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

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

Introduction

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

Prototype

CharacterLiteral(AST ast) 

Source Link

Document

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

Usage

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

License:Open Source License

public CharacterLiteral convert(org.eclipse.jdt.internal.compiler.ast.CharLiteral expression) {
    int length = expression.sourceEnd - expression.sourceStart + 1;
    int sourceStart = expression.sourceStart;
    CharacterLiteral literal = new CharacterLiteral(this.ast);
    if (this.resolveBindings) {
        this.recordNodes(literal, expression);
    }/*  w  w w  .j  a  v  a 2 s .c  o  m*/
    literal.internalSetEscapedValue(new String(this.compilationUnitSource, sourceStart, length));
    literal.setSourceRange(sourceStart, length);
    removeLeadingAndTrailingCommentsFromLiteral(literal);
    return literal;
}