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

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

Introduction

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

Prototype

ThisExpression(AST ast) 

Source Link

Document

Creates a new AST node for a "this" expression owned by the given AST.

Usage

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

License:Open Source License

public ThisExpression convert(org.eclipse.jdt.internal.compiler.ast.QualifiedThisReference reference) {
    final ThisExpression thisExpression = new ThisExpression(this.ast);
    thisExpression.setSourceRange(reference.sourceStart, reference.sourceEnd - reference.sourceStart + 1);
    thisExpression.setQualifier(convert(reference.qualification));
    if (this.resolveBindings) {
        recordNodes(thisExpression, reference);
        recordPendingThisExpressionScopeResolution(thisExpression);
    }/*w w  w.j  av  a 2s  . c  o m*/
    return thisExpression;
}

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

License:Open Source License

public Expression convert(org.eclipse.jdt.internal.compiler.ast.ThisReference reference) {
    if (reference.isImplicitThis()) {
        // There is no source associated with an implicit this
        return null;
    } else if (reference instanceof org.eclipse.jdt.internal.compiler.ast.QualifiedSuperReference) {
        return convert((org.eclipse.jdt.internal.compiler.ast.QualifiedSuperReference) reference);
    } else if (reference instanceof org.eclipse.jdt.internal.compiler.ast.QualifiedThisReference) {
        return convert((org.eclipse.jdt.internal.compiler.ast.QualifiedThisReference) reference);
    } else {//from w  w  w  . j av a  2  s  . c o m
        ThisExpression thisExpression = new ThisExpression(this.ast);
        thisExpression.setSourceRange(reference.sourceStart, reference.sourceEnd - reference.sourceStart + 1);
        if (this.resolveBindings) {
            recordNodes(thisExpression, reference);
            recordPendingThisExpressionScopeResolution(thisExpression);
        }
        return thisExpression;
    }
}