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

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

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom NumberLiteral 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 NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.DoubleLiteral expression) {
    int length = expression.sourceEnd - expression.sourceStart + 1;
    int sourceStart = expression.sourceStart;
    NumberLiteral literal = new NumberLiteral(this.ast);
    literal.internalSetToken(new String(this.compilationUnitSource, sourceStart, length));
    if (this.resolveBindings) {
        this.recordNodes(literal, expression);
    }/*w w w.  j av  a  2  s. c  om*/
    literal.setSourceRange(sourceStart, length);
    removeLeadingAndTrailingCommentsFromLiteral(literal);
    return literal;
}

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

License:Open Source License

public NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.FloatLiteral expression) {
    int length = expression.sourceEnd - expression.sourceStart + 1;
    int sourceStart = expression.sourceStart;
    NumberLiteral literal = new NumberLiteral(this.ast);
    literal.internalSetToken(new String(this.compilationUnitSource, sourceStart, length));
    if (this.resolveBindings) {
        this.recordNodes(literal, expression);
    }/*from www. ja  v a  2s . c  om*/
    literal.setSourceRange(sourceStart, length);
    removeLeadingAndTrailingCommentsFromLiteral(literal);
    return literal;
}

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

License:Open Source License

public NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.IntLiteral expression) {
    int length = expression.sourceEnd - expression.sourceStart + 1;
    int sourceStart = expression.sourceStart;
    final NumberLiteral literal = new NumberLiteral(this.ast);
    literal.internalSetToken(new String(this.compilationUnitSource, sourceStart, length));
    if (this.resolveBindings) {
        this.recordNodes(literal, expression);
    }//from w ww . j a  va 2  s .co  m
    literal.setSourceRange(sourceStart, length);
    removeLeadingAndTrailingCommentsFromLiteral(literal);
    return literal;
}

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

License:Open Source License

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

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

License:Open Source License

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

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

License:Open Source License

public NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.LongLiteralMinValue expression) {
    int length = expression.sourceEnd - expression.sourceStart + 1;
    int sourceStart = expression.sourceStart;
    final NumberLiteral literal = new NumberLiteral(this.ast);
    literal.internalSetToken(new String(this.compilationUnitSource, sourceStart, length));
    if (this.resolveBindings) {
        this.recordNodes(literal, expression);
    }// w w w.  j a  v  a  2s. c om
    literal.setSourceRange(sourceStart, length);
    removeLeadingAndTrailingCommentsFromLiteral(literal);
    return literal;
}