Added
Link Here
|
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2004 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Common Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
6 |
* http://www.eclipse.org/legal/cpl-v10.html |
7 |
* |
8 |
* Contributors: |
9 |
* IBM Corporation - initial API and implementation |
10 |
*******************************************************************************/ |
11 |
package org.eclipse.jdt.core.search; |
12 |
|
13 |
import org.eclipse.core.resources.IResource; |
14 |
import org.eclipse.jdt.core.IJavaElement; |
15 |
|
16 |
/** |
17 |
* A Java search match that represents a constructor reference. |
18 |
* The element is the inner-most enclosing member that references this method. |
19 |
* <p> |
20 |
* This class is intended to be instantiated and subclassed by clients. |
21 |
* </p> |
22 |
* |
23 |
* @since 3.1 |
24 |
*/ |
25 |
public class ConstructorReferenceMatch extends SearchMatch { |
26 |
|
27 |
private boolean synthetic; |
28 |
|
29 |
/** |
30 |
* Creates a new method reference match. |
31 |
* |
32 |
* @param enclosingElement the inner-most enclosing member that references this method |
33 |
* @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE} |
34 |
* @param offset the offset the match starts at, or -1 if unknown |
35 |
* @param length the length of the match, or -1 if unknown |
36 |
* @param insideDocComment <code>true</code> if this search match is inside a doc |
37 |
* comment, and <code>false</code> otherwise |
38 |
* @param synthetic <code>true</code> if this search match is a synthetic constructor |
39 |
* <code>false</code> otherwise |
40 |
* @param participant the search participant that created the match |
41 |
* @param resource the resource of the element |
42 |
*/ |
43 |
public ConstructorReferenceMatch(IJavaElement enclosingElement, int accuracy, int offset, int length, boolean insideDocComment, boolean synthetic, SearchParticipant participant, IResource resource) { |
44 |
super(enclosingElement, accuracy, offset, length, participant, resource); |
45 |
setInsideDocComment(insideDocComment); |
46 |
this.synthetic = synthetic; |
47 |
} |
48 |
|
49 |
/** |
50 |
* Returns whether the constructor reference is synthetic or not. |
51 |
* Note that a constructor reference can be synthetic when default constructor declaration is used |
52 |
* or imlicit super constructor is called. |
53 |
* |
54 |
* @return whether the constructor reference is synthetic or not. |
55 |
*/ |
56 |
public final boolean isSynthetic() { |
57 |
return this.synthetic; |
58 |
} |
59 |
} |