本文整理汇总了Java中org.eclipse.jdt.core.search.SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH属性的典型用法代码示例。如果您正苦于以下问题:Java SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH属性的具体用法?Java SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH怎么用?Java SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.core.search.SearchPattern
的用法示例。
在下文中一共展示了SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: matches
public boolean matches(String text) {
switch (fMatchKind) {
case SearchPattern.R_PATTERN_MATCH:
return fStringMatcher.match(text);
case SearchPattern.R_EXACT_MATCH:
return fPattern.equalsIgnoreCase(text);
case SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH:
return SearchPattern.camelCaseMatch(fPattern, text, true);
case SearchPattern.R_CAMELCASE_MATCH:
if (SearchPattern.camelCaseMatch(fPattern, text)) {
return true;
}
// fall back to prefix match if camel case failed (bug 137244)
return Strings.startsWithIgnoreCase(text, fPattern);
default:
return Strings.startsWithIgnoreCase(text, fPattern);
}
}
示例2: isCamelCasePattern
public boolean isCamelCasePattern() {
int ccMask= SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH;
return (fNameMatcher.getMatchKind() & ccMask) != 0;
}
示例3: PatternMatcher
public PatternMatcher(String pattern) {
this(pattern, SearchPattern.R_EXACT_MATCH | SearchPattern.R_PREFIX_MATCH |
SearchPattern.R_PATTERN_MATCH | SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH);
}
示例4: initializePatternAndMatchKind
private void initializePatternAndMatchKind(String pattern) {
int length= pattern.length();
if (length == 0) {
fMatchKind= SearchPattern.R_EXACT_MATCH;
fPattern= pattern;
return;
}
char last= pattern.charAt(length - 1);
if (pattern.indexOf('*') != -1 || pattern.indexOf('?') != -1) {
fMatchKind= SearchPattern.R_PATTERN_MATCH;
switch (last) {
case END_SYMBOL:
case BLANK:
fPattern= pattern.substring(0, length - 1);
break;
case ANY_STRING:
fPattern= pattern;
break;
default:
fPattern= pattern + ANY_STRING;
}
return;
}
if (last == END_SYMBOL || last == BLANK) {
fPattern= pattern.substring(0, length - 1);
if (SearchPattern.validateMatchRule(fPattern,SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH)
== SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH) {
fMatchKind= SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH;
} else {
fMatchKind= SearchPattern.R_EXACT_MATCH;
}
return;
}
if (SearchUtils.isCamelCasePattern(pattern)) {
fMatchKind= SearchPattern.R_CAMELCASE_MATCH;
fPattern= pattern;
return;
}
fMatchKind= SearchPattern.R_PREFIX_MATCH;
fPattern= pattern;
}
示例5: matchLevelForTokens
protected int matchLevelForTokens(char[][] tokens) {
if (this.pattern.pkgName == null) return ACCURATE_MATCH;
switch (this.matchMode) {
case SearchPattern.R_EXACT_MATCH:
case SearchPattern.R_PREFIX_MATCH:
if (CharOperation.prefixEquals(this.pattern.pkgName, CharOperation.concatWith(tokens, '.'), this.isCaseSensitive)) {
return POSSIBLE_MATCH;
}
break;
case SearchPattern.R_PATTERN_MATCH:
char[] patternName = this.pattern.pkgName[this.pattern.pkgName.length - 1] == '*'
? this.pattern.pkgName
: CharOperation.concat(this.pattern.pkgName, ".*".toCharArray()); //$NON-NLS-1$
if (CharOperation.match(patternName, CharOperation.concatWith(tokens, '.'), this.isCaseSensitive)) {
return POSSIBLE_MATCH;
}
break;
case SearchPattern.R_REGEXP_MATCH :
// TODO (frederic) implement regular expression match
break;
case SearchPattern.R_CAMELCASE_MATCH:
char[] packageName = CharOperation.concatWith(tokens, '.');
if (CharOperation.camelCaseMatch(this.pattern.pkgName, packageName, false)) {
return POSSIBLE_MATCH;
}
// only test case insensitive as CamelCase already verified prefix case sensitive
if (!this.isCaseSensitive && CharOperation.prefixEquals(this.pattern.pkgName, packageName, false)) {
return POSSIBLE_MATCH;
}
break;
case SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH:
if (CharOperation.camelCaseMatch(this.pattern.pkgName, CharOperation.concatWith(tokens, '.'), true)) {
return POSSIBLE_MATCH;
}
break;
}
return IMPOSSIBLE_MATCH;
}