public class TypeReferenceMatch extends ReferenceMatch
This class is intended to be instantiated and subclassed by clients.
A_ACCURATE, A_INACCURATE| Constructor and Description |
|---|
TypeReferenceMatch(IJavaElement enclosingElement,
int accuracy,
int offset,
int length,
boolean insideDocComment,
SearchParticipant participant,
IResource resource)
Creates a new type reference match.
|
| Modifier and Type | Method and Description |
|---|---|
IJavaElement[] |
getOtherElements()
Returns other elements also enclosing the type reference.
|
void |
setOtherElements(IJavaElement[] otherElements)
Sets the other elements of this search match.
|
getLocalElement, setLocalElementgetAccuracy, getElement, getLength, getOffset, getParticipant, getResource, getRule, isEquivalent, isErasure, isExact, isImplicit, isInsideDocComment, isRaw, setAccuracy, setElement, setImplicit, setInsideDocComment, setLength, setOffset, setParticipant, setRaw, setResource, setRule, toStringpublic TypeReferenceMatch(IJavaElement enclosingElement, int accuracy, int offset, int length, boolean insideDocComment, SearchParticipant participant, IResource resource)
enclosingElement - the inner-most enclosing member that references this typeaccuracy - one of SearchMatch.A_ACCURATE or SearchMatch.A_INACCURATEoffset - the offset the match starts at, or -1 if unknownlength - the length of the match, or -1 if unknowninsideDocComment - true if this search match is inside a doc
comment, and false otherwiseparticipant - the search participant that created the matchresource - the resource of the elementpublic final IJavaElement[] getOtherElements()
For example,
Test in
public class Test {
Test test1, test2, test3;
void method() {}
}
will return one match whose other elements is an array of two fields:
test2 and test3.
Test in
public class Test {
String str;
void method() {
Test local1, local2, local3;
}
}
will return one match whose other elements is an array of two local
variables: local2 and local3.
Test in
public class Test {
void testB(int testKind) {
@Annot int test1, test2;
}
}
@interface Annot {}
will return one match whose other elements is an array of one annotation:
Annot which parent is the local variable
test2.
null if nonepublic final void setOtherElements(IJavaElement[] otherElements)
otherElements - the other elements of the match,
or null if nonegetOtherElements()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.