Example usage for org.eclipse.jdt.core.search SearchPattern validateMatchRule

List of usage examples for org.eclipse.jdt.core.search SearchPattern validateMatchRule

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.search SearchPattern validateMatchRule.

Prototype

public static int validateMatchRule(String stringPattern, int matchRule) 

Source Link

Document

Validate compatibility between given string pattern and match rule.

Usage

From source file:bndtools.internal.pkgselection.SearchUtils.java

License:Open Source License

/**
 * Returns whether the given pattern is a camel case pattern or not. <em>Note: this method does not consider the
 * {@link SearchPattern#R_CAMELCASE_SAME_PART_COUNT_MATCH} variant.<em>
 * /*from w w  w .  j ava2s .c o m*/
 * @param pattern the pattern to inspect
 * @return whether it is a camel case pattern or not
 */
public static boolean isCamelCasePattern(String pattern) {
    return SearchPattern.validateMatchRule(pattern,
            SearchPattern.R_CAMELCASE_MATCH) == SearchPattern.R_CAMELCASE_MATCH;
}

From source file:ca.ecliptical.pde.ds.search.DescriptorQueryParticipant.java

License:Open Source License

private int getMatchMode(String pattern) {
    if (pattern.indexOf('*') != -1 || pattern.indexOf('?') != -1)
        return SearchPattern.R_PATTERN_MATCH;

    if (SearchPattern.validateMatchRule(pattern,
            SearchPattern.R_CAMELCASE_MATCH) == SearchPattern.R_CAMELCASE_MATCH)
        return SearchPattern.R_CAMELCASE_MATCH;

    return SearchPattern.R_EXACT_MATCH;
}