Interface IJavaSearchConstants
This interface defines the constants used by the search engine.
This interface declares constants only.
- See Also:
- Restriction:
- This interface is not intended to be implemented by clients.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe search result is a declaration, a reference, or an implementer of an interface.static final char[]The unnamed module is represented by this constant for making the intent explicit in searches involving modulesstatic final intThe searched element is an annotation type.static final intReturn only type references used as an annotation.static final intThe search operation throws anorg.eclipse.core.runtime.OperationCanceledExceptionif the underlying indexer has not finished indexing the workspace.static final booleanDeprecated.static final booleanDeprecated.Use the methods that take the matchMode withSearchPattern.R_CASE_SENSITIVEas a matchRule instead.static final intReturn only type references used in a cast expression.static final intReturn only type references used in a catch header.static final intThe searched element is a class.static final intThe searched element is a class or enum type.static final intThe searched element is a class or interface type.static final intReturn only type references used in class instance creation.static final intThe searched element is a constructor.static final intThe search result is a declaration.static final intThe searched element is an enum.static final intDeprecated.UseSearchPattern.R_EXACT_MATCHinstead.static final intThe searched element is a field.static final intReturn only type references used as the type of a field declaration.static final intThe search operation starts immediately, even if the underlying indexer has not finished indexing the workspace.static final intIgnore declaring type while searching result.static final intIgnore return type while searching result.static final intThe search result is a type that implements an interface or extends a class.static final intReturn only field accesses or method invocations without any qualification.static final intReturn only type references used in an import declaration.static final intReturn only type references used as a type of aninstanceofexpression.static final intThe searched element is an interface.static final intThe searched element is an interface or annotation type.static final intReturn only type references used as the type of a local variable declaration.static final intThe searched element is a method.static final intReturn only method reference expressions, e.g.static final intThe searched element is a module.static final intWhen searching for Type Declaration matches, and if a module is given, this will find type declaration matches in this module as well as the dependent module graph of the given module.static final intThe searched element is a package.static final intReturn only type references used as the type of a method parameter declaration.static final intDeprecated.UseSearchPattern.R_PATTERN_MATCHinstead.static final intReturn only type references used as a permit type (Java 17)static final intDeprecated.UseSearchPattern.R_PREFIX_MATCHinstead.static final intReturn only qualified field accesses or qualified method invocations.static final intWhen searching for field matches, it will exclusively find read accesses, as opposed to write accesses.static final intThe search result is a reference.static final intReturn only type references used as a method return type.static final intReturn only super field accesses or super method invocations (e.g. using thesuperqualifier).static final intReturn only type references used as a super type or as a super interface.static final intReturn only primary field accesses or primary method invocations (e.g. using thethisqualifier).static final intReturn only type references used in a throws clause.static final intThe searched element is a type, which may include classes, interfaces, enums, and annotation types.static final intReturn only type references used as a type argument in a parameterized type or a parameterized method.static final intReturn only type references used as a type variable bound.static final intThe nature of searched element or the nature of match in unknown.static final intThe search operation waits for the underlying indexer to finish indexing the workspace before starting the search.static final intReturn only type references used as a wildcard bound.static final intWhen searching for field matches, it will exclusively find write accesses, as opposed to read accesses.
-
Field Details
-
UNKNOWN
static final int UNKNOWNThe nature of searched element or the nature of match in unknown.- See Also:
-
TYPE
static final int TYPEThe searched element is a type, which may include classes, interfaces, enums, and annotation types.- See Also:
- Category:
- searchFor
-
METHOD
static final int METHODThe searched element is a method.- See Also:
- Category:
- searchFor
-
PACKAGE
static final int PACKAGEThe searched element is a package.- See Also:
- Category:
- searchFor
-
CONSTRUCTOR
static final int CONSTRUCTORThe searched element is a constructor.- See Also:
- Category:
- searchFor
-
FIELD
static final int FIELDThe searched element is a field.- See Also:
- Category:
- searchFor
-
CLASS
static final int CLASSThe searched element is a class. More selective than usingTYPE.- See Also:
- Category:
- searchFor
-
INTERFACE
static final int INTERFACEThe searched element is an interface. More selective than usingTYPE.- See Also:
- Category:
- searchFor
-
ENUM
static final int ENUMThe searched element is an enum. More selective than usingTYPE.- Since:
- 3.1
- See Also:
- Category:
- searchFor
-
ANNOTATION_TYPE
static final int ANNOTATION_TYPEThe searched element is an annotation type. More selective than usingTYPE.- Since:
- 3.1
- See Also:
- Category:
- searchFor
-
CLASS_AND_ENUM
static final int CLASS_AND_ENUMThe searched element is a class or enum type. More selective than usingTYPE.- Since:
- 3.1
- See Also:
- Category:
- searchFor
-
CLASS_AND_INTERFACE
static final int CLASS_AND_INTERFACEThe searched element is a class or interface type. More selective than usingTYPE.- Since:
- 3.1
- See Also:
- Category:
- searchFor
-
INTERFACE_AND_ANNOTATION
static final int INTERFACE_AND_ANNOTATIONThe searched element is an interface or annotation type. More selective than usingTYPE.- Since:
- 3.3
- See Also:
- Category:
- searchFor
-
MODULE
static final int MODULEThe searched element is a module.- Since:
- 3.14
- See Also:
- Category:
- searchFor
-
DECLARATIONS
static final int DECLARATIONSThe search result is a declaration. Can be used in conjunction with any of the nature of searched elements so as to better narrow down the search.- See Also:
- Category:
- limitTo
-
IMPLEMENTORS
static final int IMPLEMENTORSThe search result is a type that implements an interface or extends a class. Used in conjunction with either TYPE or CLASS or INTERFACE, it will respectively search for any type implementing/extending a type, or rather exclusively search for classes implementing/extending the type, or interfaces extending the type.- See Also:
- Category:
- limitTo
-
REFERENCES
static final int REFERENCESThe search result is a reference. Can be used in conjunction with any of the nature of searched elements so as to better narrow down the search. References can contain implementers since they are more generic kind of matches.- See Also:
- Category:
- limitTo
-
ALL_OCCURRENCES
static final int ALL_OCCURRENCESThe search result is a declaration, a reference, or an implementer of an interface. Can be used in conjunction with any of the nature of searched elements so as to better narrow down the search.- See Also:
- Category:
- limitTo
-
READ_ACCESSES
static final int READ_ACCESSESWhen searching for field matches, it will exclusively find read accesses, as opposed to write accesses. Note that some expressions are considered both as field read/write accesses: for example, x++; x+= 1;- Since:
- 2.0
- See Also:
- Category:
- limitTo
-
WRITE_ACCESSES
static final int WRITE_ACCESSESWhen searching for field matches, it will exclusively find write accesses, as opposed to read accesses. Note that some expressions are considered both as field read/write accesses: for example, x++; x+= 1;- Since:
- 2.0
- See Also:
- Category:
- limitTo
-
MODULE_GRAPH
static final int MODULE_GRAPHWhen searching for Type Declaration matches, and if a module is given, this will find type declaration matches in this module as well as the dependent module graph of the given module.- Since:
- 3.14
- See Also:
- Category:
- limitTo
-
IGNORE_DECLARING_TYPE
static final int IGNORE_DECLARING_TYPEIgnore declaring type while searching result. Can be used in conjunction with any of the nature of match.- Since:
- 3.1
- See Also:
- Category:
- limitTo
-
IGNORE_RETURN_TYPE
static final int IGNORE_RETURN_TYPEIgnore return type while searching result. Can be used in conjunction with any other nature of match. Note that:- for fields search, pattern will ignore field type
- this flag will have no effect for types search
- Since:
- 3.1
- See Also:
- Category:
- limitTo
-
FIELD_DECLARATION_TYPE_REFERENCE
static final int FIELD_DECLARATION_TYPE_REFERENCEReturn only type references used as the type of a field declaration.When this flag is set, only
TypeReferenceMatchmatches will be returned.- Since:
- 3.4
- See Also:
- Category:
- limitTo
-
LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE
static final int LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCEReturn only type references used as the type of a local variable declaration.When this flag is set, only
TypeReferenceMatchmatches will be returned.- Since:
- 3.4
- See Also:
- Category:
- limitTo
-
PARAMETER_DECLARATION_TYPE_REFERENCE
static final int PARAMETER_DECLARATION_TYPE_REFERENCEReturn only type references used as the type of a method parameter declaration.When this flag is set, only
TypeReferenceMatchmatches will be returned.- Since:
- 3.4
- See Also:
- Category:
- limitTo
-
SUPERTYPE_TYPE_REFERENCE
static final int SUPERTYPE_TYPE_REFERENCEReturn only type references used as a super type or as a super interface.When this flag is set, only
TypeReferenceMatchmatches will be returned.- Since:
- 3.4
- See Also:
- Category:
- limitTo
-
THROWS_CLAUSE_TYPE_REFERENCE
static final int THROWS_CLAUSE_TYPE_REFERENCEReturn only type references used in a throws clause.When this flag is set, only
TypeReferenceMatchmatches will be returned.- Since:
- 3.4
- See Also:
- Category:
- limitTo
-
CAST_TYPE_REFERENCE
static final int CAST_TYPE_REFERENCEReturn only type references used in a cast expression.When this flag is set, only
TypeReferenceMatchmatches will be returned.- Since:
- 3.4
- See Also:
- Category:
- limitTo
-
CATCH_TYPE_REFERENCE
static final int CATCH_TYPE_REFERENCEReturn only type references used in a catch header.When this flag is set, only
TypeReferenceMatchmatches will be returned.- Since:
- 3.4
- See Also:
- Category:
- limitTo
-
CLASS_INSTANCE_CREATION_TYPE_REFERENCE
static final int CLASS_INSTANCE_CREATION_TYPE_REFERENCEReturn only type references used in class instance creation.When this flag is set, only
TypeReferenceMatchmatches will be returned.Example:
public class Test { Test() {} static Test bar() { return new Test(); } }Searching references to the typeTestusing this flag in the above snippet will match only the reference in italic.Note that array creations are not returned when using this flag.
- Since:
- 3.4
- See Also:
- Category:
- limitTo
-
RETURN_TYPE_REFERENCE
static final int RETURN_TYPE_REFERENCEReturn only type references used as a method return type.When this flag is set, only
TypeReferenceMatchmatches will be returned.- Since:
- 3.4
- See Also:
- Category:
- limitTo
-
IMPORT_DECLARATION_TYPE_REFERENCE
static final int IMPORT_DECLARATION_TYPE_REFERENCEReturn only type references used in an import declaration.When this flag is set, only
TypeReferenceMatchmatches will be returned.- Since:
- 3.4
- See Also:
- Category:
- limitTo
-
ANNOTATION_TYPE_REFERENCE
static final int ANNOTATION_TYPE_REFERENCEReturn only type references used as an annotation.When this flag is set, only
TypeReferenceMatchmatches will be returned.- Since:
- 3.4
- See Also:
- Category:
- limitTo
-
TYPE_ARGUMENT_TYPE_REFERENCE
static final int TYPE_ARGUMENT_TYPE_REFERENCEReturn only type references used as a type argument in a parameterized type or a parameterized method.When this flag is set, only
TypeReferenceMatchmatches will be returned.- Since:
- 3.4
- See Also:
- Category:
- limitTo
-
TYPE_VARIABLE_BOUND_TYPE_REFERENCE
static final int TYPE_VARIABLE_BOUND_TYPE_REFERENCEReturn only type references used as a type variable bound.When this flag is set, only
TypeReferenceMatchmatches will be returned.- Since:
- 3.4
- See Also:
- Category:
- limitTo
-
WILDCARD_BOUND_TYPE_REFERENCE
static final int WILDCARD_BOUND_TYPE_REFERENCEReturn only type references used as a wildcard bound.When this flag is set, only
TypeReferenceMatchmatches will be returned.- Since:
- 3.4
- See Also:
- Category:
- limitTo
-
INSTANCEOF_TYPE_REFERENCE
static final int INSTANCEOF_TYPE_REFERENCEReturn only type references used as a type of aninstanceofexpression.When this flag is set, only
TypeReferenceMatchmatches will be returned.- Since:
- 3.4
- See Also:
- Category:
- limitTo
-
SUPER_REFERENCE
static final int SUPER_REFERENCEReturn only super field accesses or super method invocations (e.g. using thesuperqualifier).When this flag is set, the kind of returned matches will depend on the specified nature of the searched element:
- for the
FIELDnature, onlyFieldReferenceMatchmatches will be returned, - for the
METHODnature, onlyMethodReferenceMatchmatches will be returned.
- Since:
- 3.4
- See Also:
- Category:
- limitTo
- for the
-
QUALIFIED_REFERENCE
static final int QUALIFIED_REFERENCEReturn only qualified field accesses or qualified method invocations.When this flag is set, the kind of returned matches will depend on the specified nature of the searched element:
- for the
FIELDnature, onlyFieldReferenceMatchmatches will be returned, - for the
METHODnature, onlyMethodReferenceMatchmatches will be returned.
- Since:
- 3.4
- See Also:
- Category:
- limitTo
- for the
-
THIS_REFERENCE
static final int THIS_REFERENCEReturn only primary field accesses or primary method invocations (e.g. using thethisqualifier).When this flag is set, the kind of returned matches will depend on the specified nature of the searched element:
- for the
FIELDnature, onlyFieldReferenceMatchmatches will be returned, - for the
METHODnature, onlyMethodReferenceMatchmatches will be returned.
- Since:
- 3.4
- See Also:
- Category:
- limitTo
- for the
-
IMPLICIT_THIS_REFERENCE
static final int IMPLICIT_THIS_REFERENCEReturn only field accesses or method invocations without any qualification.When this flag is set, the kind of returned matches will depend on the specified nature of the searched element:
- for the
FIELDnature, onlyFieldReferenceMatchmatches will be returned, - for the
METHODnature, onlyMethodReferenceMatchmatches will be returned.
- Since:
- 3.4
- See Also:
- Category:
- limitTo
- for the
-
METHOD_REFERENCE_EXPRESSION
static final int METHOD_REFERENCE_EXPRESSIONReturn only method reference expressions, e.g.A::foo.When this flag is set, only
MethodReferenceMatchmatches will be returned.- Since:
- 3.10
- See Also:
- Category:
- limitTo
-
PERMITTYPE_TYPE_REFERENCE
static final int PERMITTYPE_TYPE_REFERENCEReturn only type references used as a permit type (Java 17)When this flag is set, only
TypeReferenceMatchmatches will be returned.- Since:
- 3.24
- See Also:
- Category:
- limitTo
-
EXACT_MATCH
static final int EXACT_MATCHDeprecated.UseSearchPattern.R_EXACT_MATCHinstead.The search pattern matches exactly the search result, that is, the source of the search result equals the search pattern.- See Also:
- Category:
- matchRule
-
PREFIX_MATCH
static final int PREFIX_MATCHDeprecated.UseSearchPattern.R_PREFIX_MATCHinstead.The search pattern is a prefix of the search result.- See Also:
- Category:
- matchRule
-
PATTERN_MATCH
static final int PATTERN_MATCHDeprecated.UseSearchPattern.R_PATTERN_MATCHinstead.The search pattern contains one or more wild cards ('*') where a wild-card can replace 0 or more characters in the search result.- See Also:
- Category:
- matchRule
-
CASE_SENSITIVE
static final boolean CASE_SENSITIVEDeprecated.Use the methods that take the matchMode withSearchPattern.R_CASE_SENSITIVEas a matchRule instead.The search pattern matches the search result only if cases are the same.- See Also:
- Category:
- matchRule
-
CASE_INSENSITIVE
static final boolean CASE_INSENSITIVEDeprecated.Use the methods that take the matchMode withoutSearchPattern.R_CASE_SENSITIVEas a matchRule instead.The search pattern ignores cases in the search result.- See Also:
- Category:
- matchRule
-
FORCE_IMMEDIATE_SEARCH
static final int FORCE_IMMEDIATE_SEARCHThe search operation starts immediately, even if the underlying indexer has not finished indexing the workspace. Results will more likely not contain all the matches.- See Also:
-
CANCEL_IF_NOT_READY_TO_SEARCH
static final int CANCEL_IF_NOT_READY_TO_SEARCHThe search operation throws anorg.eclipse.core.runtime.OperationCanceledExceptionif the underlying indexer has not finished indexing the workspace.- See Also:
-
WAIT_UNTIL_READY_TO_SEARCH
static final int WAIT_UNTIL_READY_TO_SEARCHThe search operation waits for the underlying indexer to finish indexing the workspace before starting the search.- See Also:
-
ALL_UNNAMED
static final char[] ALL_UNNAMEDThe unnamed module is represented by this constant for making the intent explicit in searches involving modules- Since:
- 3.14
-
SearchPattern.R_CASE_SENSITIVEas a matchRule instead.