Class JavaSearchPattern
java.lang.Object
org.aspectj.org.eclipse.jdt.core.search.SearchPattern
org.aspectj.org.eclipse.jdt.internal.core.search.matching.JavaSearchPattern
- All Implemented Interfaces:
Cloneable, IParallelizable, IIndexConstants
- Direct Known Subclasses:
ConstructorPattern, IntersectingPattern, MethodPattern, ModulePattern, MultiTypeDeclarationPattern, PackageDeclarationPattern, SuperTypeReferencePattern, TypeDeclarationPattern, TypeParameterPattern, VariablePattern
public class JavaSearchPattern
extends SearchPattern
implements IIndexConstants, IParallelizable, Cloneable
-
Field Summary
FieldsModifier and TypeFieldDescriptionintFine grain limitationstatic final intMask used on match rule for generic relevance.static final intMask used on match rule for match mode.Fields inherited from class SearchPattern
focus, indexQualifierQuery, kind, mustResolve, R_CAMELCASE_MATCH, R_CAMELCASE_SAME_PART_COUNT_MATCH, R_CASE_SENSITIVE, R_EQUIVALENT_MATCH, R_ERASURE_MATCH, R_EXACT_MATCH, R_FULL_MATCH, R_PATTERN_MATCH, R_PREFIX_MATCH, R_REGEXP_MATCH, R_SUBSTRING_MATCH, R_SUBWORD_MATCHModifier and TypeFieldDescriptionThe focus element (used for reference patterns)char[]The encoded index qualifier query which is used to narrow down number of indexes to search based on the qualifier.intbooleanstatic final intMatch rule: The search pattern contains a Camel Case expression.static final intMatch rule: The search pattern contains a Camel Case expression with a strict expected number of parts.static final intMatch rule: The search pattern matches the search result only if cases are the same.static final intMatch rule: The search pattern matches search results as raw/parameterized types/methods with equivalent type parameters.static final intMatch rule: The search pattern matches search results as raw/parameterized types/methods with same erasure.static final intMatch rule: The search pattern matches exactly the search result, that is, the source of the search result equals the search pattern.static final intMatch rule: The search pattern matches exactly the search result, that is, the source of the search result equals the search pattern.static final intMatch rule: The search pattern contains one or more wild cards ('*' or '?').static final intMatch rule: The search pattern is a prefix of the search result.static final intMatch rule: The search pattern contains a regular expression.static final intMatch rule: The search pattern contains a substring expression in a case-insensitive way.static final intMatch rule: The search pattern contains a subword expression in a case-insensitive way.Fields inherited from interface IIndexConstants
AND_PATTERN, ANNOT_REF_PATTERN, ANNOTATION_REF, ANNOTATION_TYPE_SUFFIX, CLASS_AND_ENUM_SUFFIX, CLASS_AND_INTERFACE_SUFFIX, CLASS_SUFFIX, CONSTRUCTOR_DECL, CONSTRUCTOR_PATTERN, CONSTRUCTOR_REF, COUNTS, DEFAULT_CONSTRUCTOR, ENUM_SUFFIX, FIELD_DECL, FIELD_PATTERN, INTERFACE_AND_ANNOTATION_SUFFIX, INTERFACE_SUFFIX, LOCAL_VAR_PATTERN, META_INDEX_CATEGORIES, META_INDEX_QUALIFIED_SUPER_TYPE_QUALIFIER_REF, META_INDEX_QUALIFIED_TYPE_QUALIFIER_REF, META_INDEX_SIMPLE_SUPER_TYPE_QUALIFIER_REF, META_INDEX_SIMPLE_TYPE_QUALIFIER_REF, METHOD_DECL, METHOD_DECL_PLUS, METHOD_PATTERN, METHOD_REF, MODULE_DECL, MODULE_INFO, MODULE_PATTERN, MODULE_REF, OBJECT, ONE_STAR, ONE_STAR_CHAR, ONE_ZERO, ONE_ZERO_CHAR, OR_PATTERN, PARAMETER_SEPARATOR, PKG_DECL_PATTERN, PKG_REF_PATTERN, REF, SECONDARY_SUFFIX, SEPARATOR, SUPER_REF, SUPER_REF_PATTERN, TYPE_DECL, TYPE_DECL_PATTERN, TYPE_PARAM_PATTERN, TYPE_REF_PATTERN, TYPE_SUFFIX, ZERO_CHARModifier and TypeFieldDescriptionstatic final intstatic final intstatic final char[]static final charstatic final charstatic final charstatic final charstatic final char[]static final intstatic final char[]static final char[][]/$NON-NLS-1$static final char[]static final charstatic final char[]static final intstatic final charstatic final charstatic final intstatic final char[][]static final char[]static final char[]static final char[]static final char[]static final char[]static final char[]static final intstatic final char[]static final char[]static final char[]static final intstatic final char[]static final char[]static final char[]static final char[][]static final char[]static final char[][]static final intstatic final charstatic final intstatic final intstatic final char[]static final charstatic final charstatic final char[]static final intstatic final char[]static final intstatic final intstatic final intstatic final charstatic final char -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a blank pattern that can be used as a record to decode an index key.static StringgetFineGrainFlagString(int fineGrain) final booleanReturns whether the pattern has signatures or not.final booleanReturns whether the pattern includes type arguments information or not.final booleanReturns whether the pattern includes type parameters information or not.booleanAnswerstrueif the current instance supports parallel index searchprotected StringBuilderprint(StringBuilder output) final StringtoString()Methods inherited from class SearchPattern
acceptMatch, acceptMatch, camelCaseMatch, camelCaseMatch, camelCaseMatch, camelCaseMatch, clone, createAndPattern, createOrPattern, createPattern, createPattern, createPattern, currentPattern, decodeIndexKey, findIndexMatches, findIndexMatches, getIndexCategories, getIndexKey, getMatchingRegions, getMatchRule, isPolymorphicSearch, matchesDecodedKey, matchesName, queryIn, validateMatchRuleModifier and TypeMethodDescriptionvoidacceptMatch(String relativePath, String containerPath, char separator, SearchPattern pattern, IndexQueryRequestor requestor, SearchParticipant participant, IJavaSearchScope scope) voidacceptMatch(String relativePath, String containerPath, char separator, SearchPattern pattern, IndexQueryRequestor requestor, SearchParticipant participant, IJavaSearchScope scope, org.eclipse.core.runtime.IProgressMonitor monitor) static final booleancamelCaseMatch(String pattern, int patternStart, int patternEnd, String name, int nameStart, int nameEnd) Answers true if a sub-pattern matches the sub-part of the given name using CamelCase rules, or false otherwise.static final booleancamelCaseMatch(String pattern, int patternStart, int patternEnd, String name, int nameStart, int nameEnd, boolean samePartCount) Answers true if a sub-pattern matches the sub-part of the given name using CamelCase rules, or false otherwise.static final booleancamelCaseMatch(String pattern, String name) Answers true if the pattern matches the given name using CamelCase rules, or false otherwise.static final booleancamelCaseMatch(String pattern, String name, boolean samePartCount) Answers true if the pattern matches the given name using CamelCase rules, or false otherwise.clone()static SearchPatterncreateAndPattern(SearchPattern leftPattern, SearchPattern rightPattern) Deprecated.Unfortunately, this functionality is not fully supported yet (see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=142044" for more details).static SearchPatterncreateOrPattern(SearchPattern leftPattern, SearchPattern rightPattern) Returns a search pattern that combines the given two patterns into an "or" pattern.static SearchPatterncreatePattern(String stringPattern, int searchFor, int limitTo, int matchRule) Returns a search pattern based on a given string pattern.static SearchPatterncreatePattern(IJavaElement element, int limitTo) Returns a search pattern based on a given Java element.static SearchPatterncreatePattern(IJavaElement element, int limitTo, int matchRule) Returns a search pattern based on a given Java element.voiddecodeIndexKey(char[] key) Decode the given index key in this pattern.voidfindIndexMatches(Index index, IndexQueryRequestor requestor, SearchParticipant participant, IJavaSearchScope scope, boolean resolveDocumentName, org.eclipse.core.runtime.IProgressMonitor monitor) Query a given index for matching entries.voidfindIndexMatches(Index index, IndexQueryRequestor requestor, SearchParticipant participant, IJavaSearchScope scope, org.eclipse.core.runtime.IProgressMonitor monitor) Query a given index for matching entries.char[][]Returns an array of index categories to consider for this index query.char[]Returns a key to find in relevant index categories, if null then all index entries are matched.static final int[]getMatchingRegions(String pattern, String name, int matchRule) Answers all the regions in a given name matching a given pattern using a specified match rule.final intReturns the rule to apply for matching index keys.booleanbooleanmatchesDecodedKey(SearchPattern decodedPattern) Returns whether this pattern matches the given pattern (representing a decoded index key).booleanmatchesName(char[] pattern, char[] name) Returns whether the given name matches the given pattern.static intvalidateMatchRule(String stringPattern, int matchRule) Validate compatibility between given string pattern and match rule.Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface IParallelizable
initBeforeSearchModifier and TypeMethodDescriptiondefault voidinitBeforeSearch(org.eclipse.core.runtime.IProgressMonitor monitor) Initialize all needed data before search is started
-
Field Details
-
fineGrain
public int fineGrainFine grain limitation -
MATCH_MODE_MASK
public static final int MATCH_MODE_MASKMask used on match rule for match mode.- See Also:
-
MATCH_COMPATIBILITY_MASK
public static final int MATCH_COMPATIBILITY_MASKMask used on match rule for generic relevance.- See Also:
-
-
Constructor Details
-
JavaSearchPattern
protected JavaSearchPattern(int patternKind, int matchRule)
-
-
Method Details
-
getFineGrainFlagString
-
getBlankPattern
Description copied from class:SearchPatternReturns a blank pattern that can be used as a record to decode an index key.Implementors of this method should return a new search pattern that is going to be used to decode index keys.
- Specified by:
getBlankPatternin classSearchPattern- Returns:
- a new blank pattern
- See Also:
-
hasSignatures
public final boolean hasSignatures()Returns whether the pattern has signatures or not. If patterntypeArgumentsfield, this field shows that it was built on a generic source type.- Returns:
- true if
typeSignaturesfield is not null and has a length greater than 0.
-
hasTypeArguments
public final boolean hasTypeArguments()Returns whether the pattern includes type arguments information or not.- Returns:
- default is false
-
hasTypeParameters
public final boolean hasTypeParameters()Returns whether the pattern includes type parameters information or not.- Returns:
- true if
typeArgumentscontains type parameters instead type arguments signatures.
-
print
-
toString
- Overrides:
toStringin classSearchPattern- See Also:
-
isParallelSearchSupported
public boolean isParallelSearchSupported()Description copied from interface:IParallelizableAnswerstrueif the current instance supports parallel index search- Specified by:
isParallelSearchSupportedin interfaceIParallelizable- Returns:
- Returns
trueif the implementation is safe to be used in a parallel search.
-