Example usage for org.eclipse.jdt.core.search IJavaSearchConstants QUALIFIED_REFERENCE

List of usage examples for org.eclipse.jdt.core.search IJavaSearchConstants QUALIFIED_REFERENCE

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.search IJavaSearchConstants QUALIFIED_REFERENCE.

Prototype

int QUALIFIED_REFERENCE

To view the source code for org.eclipse.jdt.core.search IJavaSearchConstants QUALIFIED_REFERENCE.

Click Source Link

Document

Return only qualified field accesses or qualified method invocations.

Usage

From source file:com.codenvy.ide.ext.java.server.internal.core.search.matching.MatchLocatorParser.java

License:Open Source License

protected void consumeMethodInvocationName() {
    super.consumeMethodInvocationName();
    MessageSend messageSend = (MessageSend) this.expressionStack[this.expressionPtr];
    if (this.patternFineGrain == 0) {
        this.patternLocator.match(messageSend, this.nodeSet);
    } else {//w  w  w . j av a  2  s. co  m
        if (messageSend.receiver.isThis()) {
            if ((this.patternFineGrain & IJavaSearchConstants.IMPLICIT_THIS_REFERENCE) != 0) {
                this.patternLocator.match(messageSend, this.nodeSet);
            }
        } else {
            if ((this.patternFineGrain & IJavaSearchConstants.QUALIFIED_REFERENCE) != 0) {
                this.patternLocator.match(messageSend, this.nodeSet);
            }
        }
    }
}

From source file:com.codenvy.ide.ext.java.server.internal.core.search.matching.MatchLocatorParser.java

License:Open Source License

protected void consumeMethodInvocationNameWithTypeArguments() {
    super.consumeMethodInvocationNameWithTypeArguments();
    MessageSend messageSend = (MessageSend) this.expressionStack[this.expressionPtr];
    if (this.patternFineGrain == 0) {
        this.patternLocator.match(messageSend, this.nodeSet);
    } else {/*from  w w w .  j av a  2  s.com*/
        if (messageSend.receiver.isThis()) {
            if ((this.patternFineGrain & IJavaSearchConstants.IMPLICIT_THIS_REFERENCE) != 0) {
                this.patternLocator.match(messageSend, this.nodeSet);
            }
        } else {
            if ((this.patternFineGrain & IJavaSearchConstants.QUALIFIED_REFERENCE) != 0) {
                this.patternLocator.match(messageSend, this.nodeSet);
            }
        }
    }
}

From source file:com.codenvy.ide.ext.java.server.internal.core.search.matching.MatchLocatorParser.java

License:Open Source License

protected NameReference getUnspecifiedReference() {
    NameReference nameRef = super.getUnspecifiedReference();
    if (this.patternFineGrain == 0) {
        this.patternLocator.match(nameRef, this.nodeSet); // NB: Don't check container since unspecified reference can happen anywhere
    } else if ((this.patternFineGrain & IJavaSearchConstants.QUALIFIED_REFERENCE) != 0) {
        if (nameRef instanceof QualifiedNameReference) {
            this.patternLocator.match(nameRef, this.nodeSet);
        }//from ww w .  j ava  2  s .  c  o m
    } else if ((this.patternFineGrain & IJavaSearchConstants.IMPLICIT_THIS_REFERENCE) != 0) {
        if (nameRef instanceof SingleNameReference) {
            this.patternLocator.match(nameRef, this.nodeSet);
        }
    }
    return nameRef;
}

From source file:com.codenvy.ide.ext.java.server.internal.core.search.matching.MatchLocatorParser.java

License:Open Source License

protected NameReference getUnspecifiedReferenceOptimized() {
    NameReference nameRef = super.getUnspecifiedReferenceOptimized();
    if (this.patternFineGrain == 0) {
        this.patternLocator.match(nameRef, this.nodeSet); // NB: Don't check container since unspecified reference can happen anywhere
    } else {/*  w  ww. j av  a 2s. c  o m*/
        boolean flagQualifiedRef = (this.patternFineGrain & IJavaSearchConstants.QUALIFIED_REFERENCE) != 0;
        boolean flagImplicitThis = (this.patternFineGrain & IJavaSearchConstants.IMPLICIT_THIS_REFERENCE) != 0;
        if (flagQualifiedRef && flagImplicitThis) {
            this.patternLocator.match(nameRef, this.nodeSet);
        } else if (flagQualifiedRef) {
            if (nameRef instanceof QualifiedNameReference) {
                this.patternLocator.match(nameRef, this.nodeSet);
            }
        } else if (flagImplicitThis) {
            if (nameRef instanceof SingleNameReference) {
                this.patternLocator.match(nameRef, this.nodeSet);
            }
        }
    }
    return nameRef;
}

From source file:org.eclipse.che.jdt.internal.core.search.matching.MatchLocatorParser.java

License:Open Source License

@Override
protected void consumeReferenceExpression(ReferenceExpression referenceExpression) {
    super.consumeReferenceExpression(referenceExpression);
    if (this.patternFineGrain == 0) {
        this.patternLocator.match(referenceExpression, this.nodeSet);
    } else if ((this.patternFineGrain & IJavaSearchConstants.METHOD_REFERENCE_EXPRESSION) != 0) {
        this.patternLocator.match(referenceExpression, this.nodeSet);
    } else if (referenceExpression.lhs.isThis()) {
        if ((this.patternFineGrain & IJavaSearchConstants.THIS_REFERENCE) != 0) {
            this.patternLocator.match(referenceExpression, this.nodeSet);
        }/*from  w w  w . j a v a2s.  co m*/
    } else if (referenceExpression.lhs.isSuper()) {
        if ((this.patternFineGrain & IJavaSearchConstants.SUPER_REFERENCE) != 0) {
            this.patternLocator.match(referenceExpression, this.nodeSet);
        }
    } else if (referenceExpression.lhs instanceof QualifiedNameReference
            || referenceExpression.lhs instanceof QualifiedTypeReference) {
        if ((this.patternFineGrain & IJavaSearchConstants.QUALIFIED_REFERENCE) != 0) {
            this.patternLocator.match(referenceExpression, this.nodeSet);
        }
    }
}

From source file:org.eclipse.che.jdt.internal.core.search.matching.MatchLocatorParser.java

License:Open Source License

protected NameReference getUnspecifiedReference(boolean rejectTypeAnnotations) {
    NameReference nameRef = super.getUnspecifiedReference(rejectTypeAnnotations);
    if (this.patternFineGrain == 0) {
        this.patternLocator.match(nameRef, this.nodeSet); // NB: Don't check container since unspecified reference can happen anywhere
    } else if ((this.patternFineGrain & IJavaSearchConstants.QUALIFIED_REFERENCE) != 0) {
        if (nameRef instanceof QualifiedNameReference) {
            this.patternLocator.match(nameRef, this.nodeSet);
        }//from  w ww  . j  a  v a  2 s  .c o m
    } else if ((this.patternFineGrain & IJavaSearchConstants.IMPLICIT_THIS_REFERENCE) != 0) {
        if (nameRef instanceof SingleNameReference) {
            this.patternLocator.match(nameRef, this.nodeSet);
        }
    }
    return nameRef;
}