Example usage for org.eclipse.jdt.internal.compiler.ast ThisReference isImplicitThis

List of usage examples for org.eclipse.jdt.internal.compiler.ast ThisReference isImplicitThis

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.ast ThisReference isImplicitThis.

Prototype

@Override
    public boolean isImplicitThis() 

Source Link

Usage

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   ww w. j ava  2s .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;
    }
}

From source file:spoon.support.compiler.jdt.JDTTreeBuilder.java

License:Open Source License

@Override
public boolean visit(ThisReference thisReference, BlockScope scope) {
    CtThisAccess<Object> thisAccess = factory.Core().createThisAccess();
    thisAccess.setImplicit(thisReference.isImplicitThis());
    thisAccess.setType(references.getTypeReference(thisReference.resolvedType));

    context.enter(thisAccess, thisReference);
    return true;// w w  w.j  ava2  s  . c  o  m
}