001: /*******************************************************************************
002: * Copyright (c) 2000, 2007 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.jdt.core.search;
011:
012: import org.eclipse.jdt.internal.core.search.processing.*;
013:
014: /**
015: * <p>
016: * This interface defines the constants used by the search engine.
017: * </p>
018: * <p>
019: * This interface declares constants only; it is not intended to be implemented.
020: * </p>
021: * @see org.eclipse.jdt.core.search.SearchEngine
022: */
023: public interface IJavaSearchConstants {
024:
025: /**
026: * The nature of searched element or the nature
027: * of match in unknown.
028: */
029: int UNKNOWN = -1;
030:
031: /* Nature of searched element */
032:
033: /**
034: * The searched element is a type, which may include classes, interfaces,
035: * enums, and annotation types.
036: */
037: int TYPE = 0;
038:
039: /**
040: * The searched element is a method.
041: */
042: int METHOD = 1;
043:
044: /**
045: * The searched element is a package.
046: */
047: int PACKAGE = 2;
048:
049: /**
050: * The searched element is a constructor.
051: */
052: int CONSTRUCTOR = 3;
053:
054: /**
055: * The searched element is a field.
056: */
057: int FIELD = 4;
058:
059: /**
060: * The searched element is a class.
061: * More selective than using {@link #TYPE}.
062: */
063: int CLASS = 5;
064:
065: /**
066: * The searched element is an interface.
067: * More selective than using {@link #TYPE}.
068: */
069: int INTERFACE = 6;
070:
071: /**
072: * The searched element is an enum.
073: * More selective than using {@link #TYPE}.
074: * @since 3.1
075: */
076: int ENUM = 7;
077:
078: /**
079: * The searched element is an annotation type.
080: * More selective than using {@link #TYPE}.
081: * @since 3.1
082: */
083: int ANNOTATION_TYPE = 8;
084:
085: /**
086: * The searched element is a class or enum type.
087: * More selective than using {@link #TYPE}.
088: * @since 3.1
089: */
090: int CLASS_AND_ENUM = 9;
091:
092: /**
093: * The searched element is a class or interface type.
094: * More selective than using {@link #TYPE}.
095: * @since 3.1
096: */
097: int CLASS_AND_INTERFACE = 10;
098:
099: /**
100: * The searched element is an interface or annotation type.
101: * More selective than using {@link #TYPE}.
102: * @since 3.3
103: */
104: int INTERFACE_AND_ANNOTATION = 11;
105:
106: /* Nature of match */
107:
108: /**
109: * The search result is a declaration.
110: * Can be used in conjunction with any of the nature of searched elements
111: * so as to better narrow down the search.
112: */
113: int DECLARATIONS = 0;
114:
115: /**
116: * The search result is a type that implements an interface or extends a class.
117: * Used in conjunction with either TYPE or CLASS or INTERFACE, it will
118: * respectively search for any type implementing/extending a type,
119: * or rather exclusively search for classes implementing/extending the type, or
120: * interfaces extending the type.
121: */
122: int IMPLEMENTORS = 1;
123:
124: /**
125: * The search result is a reference.
126: * Can be used in conjunction with any of the nature of searched elements
127: * so as to better narrow down the search.
128: * References can contain implementers since they are more generic kind
129: * of matches.
130: */
131: int REFERENCES = 2;
132:
133: /**
134: * The search result is a declaration, a reference, or an implementer
135: * of an interface.
136: * Can be used in conjunction with any of the nature of searched elements
137: * so as to better narrow down the search.
138: */
139: int ALL_OCCURRENCES = 3;
140:
141: /**
142: * When searching for field matches, it will exclusively find read accesses, as
143: * opposed to write accesses. Note that some expressions are considered both
144: * as field read/write accesses: for example, x++; x+= 1;
145: *
146: * @since 2.0
147: */
148: int READ_ACCESSES = 4;
149:
150: /**
151: * When searching for field matches, it will exclusively find write accesses, as
152: * opposed to read accesses. Note that some expressions are considered both
153: * as field read/write accesses: for example, x++; x+= 1;
154: *
155: * @since 2.0
156: */
157: int WRITE_ACCESSES = 5;
158:
159: /**
160: * Ignore declaring type while searching result.
161: * Can be used in conjunction with any of the nature of match.
162: * @since 3.1
163: */
164: int IGNORE_DECLARING_TYPE = 0x10;
165:
166: /**
167: * Ignore return type while searching result.
168: * Can be used in conjunction with any of the nature of match.
169: * Note that:
170: * <ul>
171: * <li>for fields search, pattern will ignore field type</li>
172: * <li>this flag will have no effect for types search</li>
173: * </ul>
174: * @since 3.1
175: */
176: int IGNORE_RETURN_TYPE = 0x20;
177:
178: /* Syntactic match modes */
179:
180: /**
181: * The search pattern matches exactly the search result,
182: * that is, the source of the search result equals the search pattern.
183: * @deprecated Use {@link SearchPattern#R_EXACT_MATCH} instead.
184: */
185: int EXACT_MATCH = 0;
186: /**
187: * The search pattern is a prefix of the search result.
188: * @deprecated Use {@link SearchPattern#R_PREFIX_MATCH} instead.
189: */
190: int PREFIX_MATCH = 1;
191: /**
192: * The search pattern contains one or more wild cards ('*') where a
193: * wild-card can replace 0 or more characters in the search result.
194: * @deprecated Use {@link SearchPattern#R_PATTERN_MATCH} instead.
195: */
196: int PATTERN_MATCH = 2;
197:
198: /* Case sensitivity */
199:
200: /**
201: * The search pattern matches the search result only
202: * if cases are the same.
203: * @deprecated Use the methods that take the matchMode
204: * with {@link SearchPattern#R_CASE_SENSITIVE} as a matchRule instead.
205: */
206: boolean CASE_SENSITIVE = true;
207: /**
208: * The search pattern ignores cases in the search result.
209: * @deprecated Use the methods that take the matchMode
210: * without {@link SearchPattern#R_CASE_SENSITIVE} as a matchRule instead.
211: */
212: boolean CASE_INSENSITIVE = false;
213:
214: /* Waiting policies */
215:
216: /**
217: * The search operation starts immediately, even if the underlying indexer
218: * has not finished indexing the workspace. Results will more likely
219: * not contain all the matches.
220: */
221: int FORCE_IMMEDIATE_SEARCH = IJob.ForceImmediate;
222: /**
223: * The search operation throws an <code>org.eclipse.core.runtime.OperationCanceledException</code>
224: * if the underlying indexer has not finished indexing the workspace.
225: */
226: int CANCEL_IF_NOT_READY_TO_SEARCH = IJob.CancelIfNotReady;
227: /**
228: * The search operation waits for the underlying indexer to finish indexing
229: * the workspace before starting the search.
230: */
231: int WAIT_UNTIL_READY_TO_SEARCH = IJob.WaitUntilReady;
232:
233: }
|