Example usage for org.eclipse.jdt.core.dom TypeLiteral setSourceRange

List of usage examples for org.eclipse.jdt.core.dom TypeLiteral setSourceRange

Introduction

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

Prototype

public final void setSourceRange(int startPosition, int length) 

Source Link

Document

Sets the source range of the original source file where the source fragment corresponding to this node was found.

Usage

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

License:Open Source License

public Expression convert(org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess expression) {
    TypeLiteral typeLiteral = new TypeLiteral(this.ast);
    if (this.resolveBindings) {
        this.recordNodes(typeLiteral, expression);
    }//ww w  . j a v a 2 s.  c o m
    typeLiteral.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1);
    typeLiteral.setType(convertType(expression.type));
    return typeLiteral;
}