|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.internal.core.search.matching.InternalSearchPattern
org.eclipse.jdt.core.search.SearchPattern
public abstract class SearchPattern
A search pattern defines how search results are found. Use SearchPattern.createPattern
to create a search pattern.
Search patterns are used during the search phase to decode index entries that were added during the indexing phase
(see SearchDocument.addIndexEntry(char[], char[])
). When an index is queried, the
index categories and keys to consider are retrieved from the search pattern using getIndexCategories()
and
getIndexKey()
, as well as the match rule (see getMatchRule()
). A blank pattern is
then created (see getBlankPattern()
). This blank pattern is used as a record as follows.
For each index entry in the given index categories and that starts with the given key, the blank pattern is fed using
decodeIndexKey(char[])
. The original pattern is then asked if it matches the decoded key using
matchesDecodedKey(SearchPattern)
. If it matches, a search document is created for this index entry
using SearchParticipant.getDocument(String)
.
This class is intended to be sub-classed by clients. A default behavior is provided for each of the methods above, that clients can override if they wish.
createPattern(org.eclipse.jdt.core.IJavaElement, int)
,
createPattern(String, int, int, int)
Field Summary | |
---|---|
static int |
R_CAMELCASE_MATCH
Match rule: The search pattern contains a Camel Case expression. |
static int |
R_CAMELCASE_SAME_PART_COUNT_MATCH
Match rule: The search pattern contains a Camel Case expression with a strict expected number of parts. |
static int |
R_CASE_SENSITIVE
Match rule: The search pattern matches the search result only if cases are the same. |
static int |
R_EQUIVALENT_MATCH
Match rule: The search pattern matches search results as raw/parameterized types/methods with equivalent type parameters. |
static int |
R_ERASURE_MATCH
Match rule: The search pattern matches search results as raw/parameterized types/methods with same erasure. |
static int |
R_EXACT_MATCH
Match rule: The search pattern matches exactly the search result, that is, the source of the search result equals the search pattern. |
static int |
R_FULL_MATCH
Match rule: The search pattern matches exactly the search result, that is, the source of the search result equals the search pattern. |
static int |
R_PATTERN_MATCH
Match rule: The search pattern contains one or more wild cards ('*' or '?'). |
static int |
R_PREFIX_MATCH
Match rule: The search pattern is a prefix of the search result. |
static int |
R_REGEXP_MATCH
Match rule: The search pattern contains a regular expression. |
Constructor Summary | |
---|---|
SearchPattern(int matchRule)
Creates a search pattern with the rule to apply for matching index keys. |
Method Summary | |
---|---|
static boolean |
camelCaseMatch(java.lang.String pattern,
int patternStart,
int patternEnd,
java.lang.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 boolean |
camelCaseMatch(java.lang.String pattern,
int patternStart,
int patternEnd,
java.lang.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 boolean |
camelCaseMatch(java.lang.String pattern,
java.lang.String name)
Answers true if the pattern matches the given name using CamelCase rules, or false otherwise. |
static boolean |
camelCaseMatch(java.lang.String pattern,
java.lang.String name,
boolean samePartCount)
Answers true if the pattern matches the given name using CamelCase rules, or false otherwise. |
static SearchPattern |
createAndPattern(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). This might be done in a further version... |
static SearchPattern |
createOrPattern(SearchPattern leftPattern,
SearchPattern rightPattern)
Returns a search pattern that combines the given two patterns into an "or" pattern. |
static SearchPattern |
createPattern(IJavaElement element,
int limitTo)
Returns a search pattern based on a given Java element. |
static SearchPattern |
createPattern(IJavaElement element,
int limitTo,
int matchRule)
Returns a search pattern based on a given Java element. |
static SearchPattern |
createPattern(java.lang.String stringPattern,
int searchFor,
int limitTo,
int matchRule)
Returns a search pattern based on a given string pattern. |
void |
decodeIndexKey(char[] key)
Decode the given index key in this pattern. |
abstract SearchPattern |
getBlankPattern()
Returns a blank pattern that can be used as a record to decode an index key. |
char[][] |
getIndexCategories()
Returns an array of index categories to consider for this index query. |
char[] |
getIndexKey()
Returns a key to find in relevant index categories, if null then all index entries are matched. |
int |
getMatchRule()
Returns the rule to apply for matching index keys. |
boolean |
matchesDecodedKey(SearchPattern decodedPattern)
Returns whether this pattern matches the given pattern (representing a decoded index key). |
boolean |
matchesName(char[] pattern,
char[] name)
Returns whether the given name matches the given pattern. |
java.lang.String |
toString()
|
static int |
validateMatchRule(java.lang.String stringPattern,
int matchRule)
Validate compatibility between given string pattern and match rule. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int R_EXACT_MATCH
public static final int R_PREFIX_MATCH
public static final int R_PATTERN_MATCH
public static final int R_REGEXP_MATCH
public static final int R_CASE_SENSITIVE
R_EXACT_MATCH
| R_CASE_SENSITIVE
public static final int R_ERASURE_MATCH
List<Exception>
List<Object>
<T>foo(T t)
<Exception>foo(new Exception())
<Object>foo(new Object())
R_CASE_SENSITIVE
| R_ERASURE_MATCH
This rule is not activated by default, so raw types or parameterized types with same erasure will not be found
for pattern List<String>,
Note that with this pattern, the match selection will be only on the erasure even for parameterized types.
public static final int R_EQUIVALENT_MATCH
List<Exception>
List<? extends Throwable>
List<? super RuntimeException>
List<?>
<T>foo(T t)
<Exception>foo(new Exception())
<? extends Throwable>foo(new Exception())
<? super RuntimeException>foo(new Exception())
foo(new Exception())
R_CASE_SENSITIVE
| R_EQUIVALENT_MATCH
This rule is not activated by default, so raw types or equivalent parameterized types will not be found
for pattern List<String>,
This mode is overridden by R_ERASURE_MATCH
as erasure matches obviously include equivalent ones.
That means that pattern with rule set to R_EQUIVALENT_MATCH
| R_ERASURE_MATCH
will return same results than rule only set with R_ERASURE_MATCH
.
public static final int R_FULL_MATCH
public static final int R_CAMELCASE_MATCH
Examples:
validateMatchRule(String, int)
for more details).
for a detailed explanation of Camel
Case matching.
,
Constant Field Valuespublic static final int R_CAMELCASE_SAME_PART_COUNT_MATCH
validateMatchRule(String, int)
for more details).
for a detailed
explanation of Camel Case matching.
,
Constant Field ValuesConstructor Detail |
---|
public SearchPattern(int matchRule)
matchRule
- one of following match rule
R_EXACT_MATCH
R_PREFIX_MATCH
R_PATTERN_MATCH
R_REGEXP_MATCH
R_CAMELCASE_MATCH
R_CAMELCASE_SAME_PART_COUNT_MATCH
R_EXACT_MATCH
| R_CASE_SENSITIVE
: if an exact
and case sensitive match is requested,R_PREFIX_MATCH
if a case insensitive prefix match is requestedR_EXACT_MATCH
| R_ERASURE_MATCH
: if a case
insensitive and erasure match is requested.R_ERASURE_MATCH
or R_EQUIVALENT_MATCH
has no effect
on non-generic types/methods search.
Note also that default behavior for generic types/methods search is to find exact matches.
Method Detail |
---|
public static final boolean camelCaseMatch(java.lang.String pattern, java.lang.String name)
CamelCase denotes the convention of writing compound names without spaces, and capitalizing every term. This function recognizes both upper and lower CamelCase, depending whether the leading character is capitalized or not. The leading part of an upper CamelCase pattern is assumed to contain a sequence of capitals which are appearing in the matching name; e.g. 'NPE' will match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern uses a lowercase first character. In Java, type names follow the upper CamelCase convention, whereas method or field names follow the lower CamelCase convention.
The pattern may contain lowercase characters, which will be matched in a case sensitive way. These characters must appear in sequence in the name. For instance, 'NPExcep' will match 'NullPointerException', but not 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not 'NoPointerException'.
Digit characters are treated in a special way. They can be used in the pattern but are not always considered as leading character. For instance, both 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'.
Using this method allows matching names to have more parts than the specified
pattern (see camelCaseMatch(String, String, boolean)
).
For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap',
'HatMapper' and also 'HashMapEntry'.
Examples:
- pattern = "NPE" name = NullPointerException / NoPermissionException result => true
- pattern = "NuPoEx" name = NullPointerException result => true
- pattern = "npe" name = NullPointerException result => false
- pattern = "IPL3" name = "IPerspectiveListener3" result => true
- pattern = "HM" name = "HashMapEntry" result => true
- pattern = "HMap" name = "HatMapper" result => true
pattern
- the given patternname
- the given name
for algorithm
implementation
public static final boolean camelCaseMatch(java.lang.String pattern, java.lang.String name, boolean samePartCount)
CamelCase denotes the convention of writing compound names without spaces, and capitalizing every term. This function recognizes both upper and lower CamelCase, depending whether the leading character is capitalized or not. The leading part of an upper CamelCase pattern is assumed to contain a sequence of capitals which are appearing in the matching name; e.g. 'NPE' will match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern uses a lowercase first character. In Java, type names follow the upper CamelCase convention, whereas method or field names follow the lower CamelCase convention.
The pattern may contain lowercase characters, which will be matched in a case sensitive way. These characters must appear in sequence in the name. For instance, 'NPExcep' will match 'NullPointerException', but not 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not 'NoPointerException'.
Digit characters are treated in a special way. They can be used in the pattern but are not always considered as leading character. For instance, both 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'.
CamelCase can be restricted to match only the same count of parts. When this
restriction is specified the given pattern and the given name must have exactly
the same number of parts (i.e. the same number of uppercase characters).
For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap' and
'HatMapper' but not 'HashMapEntry'.
Examples:
- pattern = "NPE" name = NullPointerException / NoPermissionException result => true
- pattern = "NuPoEx" name = NullPointerException result => true
- pattern = "npe" name = NullPointerException result => false
- pattern = "IPL3" name = "IPerspectiveListener3" result => true
- pattern = "HM" name = "HashMapEntry" result => (samePartCount == false)
pattern
- the given patternname
- the given namesamePartCount
- flag telling whether the pattern and the name should
have the same count of parts or not.for algorithm
implementation
public static final boolean camelCaseMatch(java.lang.String pattern, int patternStart, int patternEnd, java.lang.String name, int nameStart, int nameEnd)
CamelCase denotes the convention of writing compound names without spaces, and capitalizing every term. This function recognizes both upper and lower CamelCase, depending whether the leading character is capitalized or not. The leading part of an upper CamelCase pattern is assumed to contain a sequence of capitals which are appearing in the matching name; e.g. 'NPE' will match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern uses a lowercase first character. In Java, type names follow the upper CamelCase convention, whereas method or field names follow the lower CamelCase convention.
The pattern may contain lowercase characters, which will be matched in a case sensitive way. These characters must appear in sequence in the name. For instance, 'NPExcep' will match 'NullPointerException', but not 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not 'NoPointerException'.
Digit characters are treated in a special way. They can be used in the pattern but are not always considered as leading character. For instance, both 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'.
Digit characters are treated in a special way. They can be used in the pattern but are not always considered as leading character. For instance, both 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'.
Using this method allows matching names to have more parts than the specified
pattern (see camelCaseMatch(String, int, int, String, int, int, boolean)
).
For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap',
'HatMapper' and also 'HashMapEntry'.
Examples:
- pattern = "NPE" patternStart = 0 patternEnd = 3 name = NullPointerException nameStart = 0 nameEnd = 20 result => true
- pattern = "NPE" patternStart = 0 patternEnd = 3 name = NoPermissionException nameStart = 0 nameEnd = 21 result => true
- pattern = "NuPoEx" patternStart = 0 patternEnd = 6 name = NullPointerException nameStart = 0 nameEnd = 20 result => true
- pattern = "NuPoEx" patternStart = 0 patternEnd = 6 name = NoPermissionException nameStart = 0 nameEnd = 21 result => false
- pattern = "npe" patternStart = 0 patternEnd = 3 name = NullPointerException nameStart = 0 nameEnd = 20 result => false
- pattern = "IPL3" patternStart = 0 patternEnd = 3 name = "IPerspectiveListener3" nameStart = 0 nameEnd = 21 result => true
- pattern = "HM" patternStart = 0 patternEnd = 2 name = "HashMapEntry" nameStart = 0 nameEnd = 12 result => true
- pattern = "HMap" patternStart = 0 patternEnd = 4 name = "HatMapper" nameStart = 0 nameEnd = 9 result => true
pattern
- the given patternpatternStart
- the start index of the pattern, inclusivepatternEnd
- the end index of the pattern, exclusivename
- the given namenameStart
- the start index of the name, inclusivenameEnd
- the end index of the name, exclusive
public static final boolean camelCaseMatch(java.lang.String pattern, int patternStart, int patternEnd, java.lang.String name, int nameStart, int nameEnd, boolean samePartCount)
CamelCase denotes the convention of writing compound names without spaces, and capitalizing every term. This function recognizes both upper and lower CamelCase, depending whether the leading character is capitalized or not. The leading part of an upper CamelCase pattern is assumed to contain a sequence of capitals which are appearing in the matching name; e.g. 'NPE' will match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern uses a lowercase first character. In Java, type names follow the upper CamelCase convention, whereas method or field names follow the lower CamelCase convention.
The pattern may contain lowercase characters, which will be matched in a case sensitive way. These characters must appear in sequence in the name. For instance, 'NPExcep' will match 'NullPointerException', but not 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not 'NoPointerException'.
Digit characters are treated in a special way. They can be used in the pattern but are not always considered as leading character. For instance, both 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'.
CamelCase can be restricted to match only the same count of parts. When this
restriction is specified the given pattern and the given name must have exactly
the same number of parts (i.e. the same number of uppercase characters).
For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap' and
'HatMapper' but not 'HashMapEntry'.
Examples:
- pattern = "NPE" patternStart = 0 patternEnd = 3 name = NullPointerException nameStart = 0 nameEnd = 20 result => true
- pattern = "NPE" patternStart = 0 patternEnd = 3 name = NoPermissionException nameStart = 0 nameEnd = 21 result => true
- pattern = "NuPoEx" patternStart = 0 patternEnd = 6 name = NullPointerException nameStart = 0 nameEnd = 20 result => true
- pattern = "NuPoEx" patternStart = 0 patternEnd = 6 name = NoPermissionException nameStart = 0 nameEnd = 21 result => false
- pattern = "npe" patternStart = 0 patternEnd = 3 name = NullPointerException nameStart = 0 nameEnd = 20 result => false
- pattern = "IPL3" patternStart = 0 patternEnd = 3 name = "IPerspectiveListener3" nameStart = 0 nameEnd = 21 result => true
- pattern = "HM" patternStart = 0 patternEnd = 2 name = "HashMapEntry" nameStart = 0 nameEnd = 12 result => (samePartCount == false)
pattern
- the given patternpatternStart
- the start index of the pattern, inclusivepatternEnd
- the end index of the pattern, exclusivename
- the given namenameStart
- the start index of the name, inclusivenameEnd
- the end index of the name, exclusivesamePartCount
- flag telling whether the pattern and the name should
have the same count of parts or not.from which algorithm implementation has been entirely copied.
public static SearchPattern createAndPattern(SearchPattern leftPattern, SearchPattern rightPattern)
leftPattern
- the left patternrightPattern
- the right pattern
public static SearchPattern createOrPattern(SearchPattern leftPattern, SearchPattern rightPattern)
leftPattern
- the left patternrightPattern
- the right pattern
public static SearchPattern createPattern(java.lang.String stringPattern, int searchFor, int limitTo, int matchRule)
Object
:
createSearchPattern("Object", IJavaSearchConstants.TYPE, IJavaSearchConstants.REFERENCES, false);
Object()
constructor:
createSearchPattern("java.lang.Object()", IJavaSearchConstants.CONSTRUCTOR, IJavaSearchConstants.REFERENCES, true);
java.lang.Runnable
:
createSearchPattern("java.lang.Runnable", IJavaSearchConstants.TYPE, IJavaSearchConstants.IMPLEMENTORS, true);
stringPattern
- the given pattern
[qualification '.']typeName ['<' typeArguments '>']
Some samples:
Type arguments can be specified to search for references to parameterized types using following syntax:
'<' { [ '?' {'extends'|'super'} ] type ( ',' [ '?' {'extends'|'super'} ] type )* | '?' } '>'
Note that:
[declaringType '.'] ['<' typeArguments '>'] methodName ['(' parameterTypes ')'] [returnType]
Type arguments have the same syntax as explained in the type patterns section
Some samples:
['<' typeArguments '>'] [declaringQualification '.'] typeName ['(' parameterTypes ')']
Type arguments have the same syntax as explained in the type patterns section
Some samples:
[declaringType '.'] fieldName [fieldType]
Some samples:
packageNameSegment {'.' packageNameSegment}
Some samples:
searchFor
- determines the nature of the searched elements
IJavaSearchConstants.CLASS
: only look for classesIJavaSearchConstants.INTERFACE
: only look for interfacesIJavaSearchConstants.ENUM
: only look for enumerationIJavaSearchConstants.ANNOTATION_TYPE
: only look for annotation typeIJavaSearchConstants.CLASS_AND_ENUM
: only look for classes and enumerationsIJavaSearchConstants.CLASS_AND_INTERFACE
: only look for classes and interfacesIJavaSearchConstants.TYPE
: look for all types (i.e. classes, interfaces, enum and annotation types)IJavaSearchConstants.FIELD
: look for fieldsIJavaSearchConstants.METHOD
: look for methodsIJavaSearchConstants.CONSTRUCTOR
: look for constructorsIJavaSearchConstants.PACKAGE
: look for packageslimitTo
- determines the nature of the expected matches
IJavaSearchConstants.DECLARATIONS
: will search declarations matching
with the corresponding element. In case the element is a method, declarations of matching
methods in sub-types will also be found, allowing to find declarations of abstract methods, etc.IJavaSearchConstants.IGNORE_DECLARING_TYPE
and
IJavaSearchConstants.IGNORE_RETURN_TYPE
are ignored for string patterns.
This is due to the fact that client may omit to define them in string pattern to have same behavior.
IJavaSearchConstants.REFERENCES
: will search references to the given element.IJavaSearchConstants.ALL_OCCURRENCES
: will search for either declarations or
references as specified above.
IJavaSearchConstants.IMPLEMENTORS
: for types, will find all types
which directly implement/extend a given interface.
Note that types may be only classes or only interfaces if IJavaSearchConstants.CLASS
or
IJavaSearchConstants.INTERFACE
is respectively used instead of IJavaSearchConstants.TYPE
.
matchRule
- one of the following match rules
R_EXACT_MATCH
R_PREFIX_MATCH
R_PATTERN_MATCH
R_REGEXP_MATCH
R_CAMELCASE_MATCH
R_CAMELCASE_SAME_PART_COUNT_MATCH
R_EXACT_MATCH
| R_CASE_SENSITIVE
: if an exact
and case sensitive match is requested,R_PREFIX_MATCH
if a case insensitive prefix match is requestedR_EXACT_MATCH
| R_ERASURE_MATCH
: if a case
insensitive and erasure match is requested.R_ERASURE_MATCH
or R_EQUIVALENT_MATCH
has no effect
on non-generic types/methods search.
Note also that the default behavior for generic types/methods search is to find exact matches.
null
if the string pattern is ill-formedpublic static SearchPattern createPattern(IJavaElement element, int limitTo)
R_ERASURE_MATCH
matches.
If other kind of generic matches (i.e. R_EXACT_MATCH
or R_EQUIVALENT_MATCH
)
are expected, createPattern(IJavaElement, int, int)
method need to be used instead with
the explicit match rule specified.
element
- the Java element the search pattern is based onlimitTo
- determines the nature of the expected matches
IJavaSearchConstants.DECLARATIONS
: will search declarations matching
with the corresponding element. In case the element is a method, declarations of matching
methods in sub-types will also be found, allowing to find declarations of abstract methods, etc.
Some additional flags may be specified while searching declaration:
IJavaSearchConstants.IGNORE_DECLARING_TYPE
: declaring type will be ignored
during the search.class A { A method() { return null; } } class B extends A { B method() { return null; } } class C { A method() { return null; } }search for
method
declaration with this flag
will return 2 matches: in A and in C
IJavaSearchConstants.IGNORE_RETURN_TYPE
: return type will be ignored
during the search.method
declaration with this flag
will return 2 matches: in A and in B.
method
declaration
with these 2 flags will return 3 matches: in A, in B and in C
IJavaSearchConstants.REFERENCES
: will search references to the given element.IJavaSearchConstants.ALL_OCCURRENCES
: will search for either declarations or
references as specified above.
IJavaSearchConstants.IMPLEMENTORS
: for types, will find all types
which directly implement/extend a given interface.
null
if the given element is ill-formedpublic static SearchPattern createPattern(IJavaElement element, int limitTo, int matchRule)
element
- the Java element the search pattern is based onlimitTo
- determines the nature of the expected matches
IJavaSearchConstants.DECLARATIONS
: will search declarations matching
with the corresponding element. In case the element is a method, declarations of matching
methods in sub-types will also be found, allowing to find declarations of abstract methods, etc.
Some additional flags may be specified while searching declaration:
IJavaSearchConstants.IGNORE_DECLARING_TYPE
: declaring type will be ignored
during the search.class A { A method() { return null; } } class B extends A { B method() { return null; } } class C { A method() { return null; } }search for
method
declaration with this flag
will return 2 matches: in A and in C
IJavaSearchConstants.IGNORE_RETURN_TYPE
: return type will be ignored
during the search.method
declaration with this flag
will return 2 matches: in A and in B.
method
declaration
with these 2 flags will return 3 matches: in A, in B and in C
IJavaSearchConstants.REFERENCES
: will search references to the given element.IJavaSearchConstants.ALL_OCCURRENCES
: will search for either declarations or
references as specified above.
IJavaSearchConstants.IMPLEMENTORS
: for types, will find all types
which directly implement/extend a given interface.
matchRule
- one of the following match rules:
R_EXACT_MATCH
R_PREFIX_MATCH
R_PATTERN_MATCH
R_REGEXP_MATCH
R_CAMELCASE_MATCH
R_CAMELCASE_SAME_PART_COUNT_MATCH
R_EXACT_MATCH
| R_CASE_SENSITIVE
: if an exact
and case sensitive match is requested,R_PREFIX_MATCH
if a case insensitive prefix match is requestedR_EXACT_MATCH
| R_ERASURE_MATCH
: if a case
insensitive and erasure match is requested.R_ERASURE_MATCH
or R_EQUIVALENT_MATCH
has no effect
on non-generic types/methods search.
Note also that default behavior for generic types/methods search is to find exact matches.
null
if the given element is ill-formedpublic void decodeIndexKey(char[] key)
matchesDecodedKey(SearchPattern)
to find out if the corresponding index entry
should be considered.
This method should be re-implemented in subclasses that need to decode an index key.
key
- the given index keypublic abstract SearchPattern getBlankPattern()
Implementors of this method should return a new search pattern that is going to be used to decode index keys.
decodeIndexKey(char[])
public char[] getIndexKey()
This method should be re-implemented in subclasses that need to narrow down the index query.
null
if all index entries are matched.public char[][] getIndexCategories()
This method should be re-implemented in subclasses that need to narrow down the index query.
public final int getMatchRule()
public boolean matchesDecodedKey(SearchPattern decodedPattern)
This method should be re-implemented in subclasses that need to narrow down the index query.
decodedPattern
- a pattern representing a decoded index key
public boolean matchesName(char[] pattern, char[] name)
This method should be re-implemented in subclasses that need to define how a name matches a pattern.
pattern
- the given pattern, or null
to represent "*"name
- the given name
public static int validateMatchRule(java.lang.String stringPattern, int matchRule)
R_REGEXP_MATCH
flag is set, then the pattern is
rejected as this kind of match is not supported yet and -1
is returned).
R_PATTERN_MATCH
flag), then the pattern match flag is reset.R_PATTERN_MATCH
flag is set then, other
R_PREFIX_MATCH
, R_CAMELCASE_MATCH
or
R_CAMELCASE_SAME_PART_COUNT_MATCH
flags are reset
if they are tentatively combined.
R_CAMELCASE_MATCH
flag is set, then other
R_PREFIX_MATCH
or R_CAMELCASE_SAME_PART_COUNT_MATCH
flags are reset if they are tentatively combined.R_CAMELCASE_SAME_PART_COUNT_MATCH
flag is set,
then (R_PREFIX_MATCH
flag is reset if it's tentatively
combined.
stringPattern
- The string patternmatchRule
- The match rule
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |