本文整理匯總了Java中org.springframework.util.PatternMatchUtils.simpleMatch方法的典型用法代碼示例。如果您正苦於以下問題:Java PatternMatchUtils.simpleMatch方法的具體用法?Java PatternMatchUtils.simpleMatch怎麽用?Java PatternMatchUtils.simpleMatch使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.util.PatternMatchUtils的用法示例。
在下文中一共展示了PatternMatchUtils.simpleMatch方法的33個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。
示例1: getWebSocketBrokarage
點讚 3
import org.springframework.util.PatternMatchUtils; //導入方法依賴的package包/類
private ZuulWebSocketProperties.WsBrokerage getWebSocketBrokarage(URI uri) {
String path = uri.toString();
if (path.contains(":")) {
path = UriComponentsBuilder.fromUriString(path).build().getPath();
}
for (Map.Entry entry : zuulWebSocketProperties
.getBrokerages().entrySet()) {
ZuulWebSocketProperties.WsBrokerage wsBrokerage = entry.getValue();
if (wsBrokerage.isEnabled()) {
for (String endPoint : wsBrokerage.getEndPoints()) {
if (PatternMatchUtils.simpleMatch(toPattern(endPoint), path + "/")) {
return wsBrokerage;
}
}
}
}
return null;
}
開發者ID:mthizo247,項目名稱:spring-cloud-netflix-zuul-websocket,代碼行數:21,
示例2: findImage
點讚 3
import org.springframework.util.PatternMatchUtils; //導入方法依賴的package包/類
/**
* Find image by its name, or id
* @param name
* @param imageId
* @return
*/
public Image findImage(String name, String imageId) {
Image res = null;
if(imageId != null) {
res = imagesByName.get(imageId);
}
String withoutTag = ImageName.withoutTagOrNull(name);
if(res == null && withoutTag != null) {
res = imagesByName.get(withoutTag);
}
if(res == null && (imageId != null || withoutTag != null)) {
for(Image img: imagesWithPattern) {
String pattern = img.getName();
if(withoutTag != null && PatternMatchUtils.simpleMatch(pattern, withoutTag) ||
imageId != null && PatternMatchUtils.simpleMatch(pattern, imageId)) {
res = img;
break;
}
}
}
return res;
}
開發者ID:codeabovelab,項目名稱:haven-platform,代碼行數:28,
示例3: getErrorCodes
點讚 2
import org.springframework.util.PatternMatchUtils; //導入方法依賴的package包/類
/**
* Return the {@link SQLErrorCodes} instance for the given database.
*
No need for a database metadata lookup.
* @param dbName the database name (must not be {@code null})
* @return the {@code SQLErrorCodes} instance for the given database
* @throws IllegalArgumentException if the supplied database name is {@code null}
*/
public SQLErrorCodes getErrorCodes(String dbName) {
Assert.notNull(dbName, "Database product name must not be null");
SQLErrorCodes sec = this.errorCodesMap.get(dbName);
if (sec == null) {
for (SQLErrorCodes candidate : this.errorCodesMap.values()) {
if (PatternMatchUtils.simpleMatch(candidate.getDatabaseProductNames(), dbName)) {
sec = candidate;
break;
}
}
}
if (sec != null) {
checkCustomTranslatorRegistry(dbName, sec);
if (logger.isDebugEnabled()) {
logger.debug("SQL error codes for '" + dbName + "' found");
}
return sec;
}
// Could not find the database among the defined ones.
if (logger.isDebugEnabled()) {
logger.debug("SQL error codes for '" + dbName + "' not found");
}
return new SQLErrorCodes();
}
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:34,
示例4: getWebSocketServerPath
點讚 2
import org.springframework.util.PatternMatchUtils; //導入方法依賴的package包/類
private String getWebSocketServerPath(ZuulWebSocketProperties.WsBrokerage wsBrokerage,
URI uri) {
String path = uri.toString();
if (path.contains(":")) {
path = UriComponentsBuilder.fromUriString(path).build().getPath();
}
for (String endPoint : wsBrokerage.getEndPoints()) {
if (PatternMatchUtils.simpleMatch(toPattern(endPoint), path + "/")) {
return endPoint;
}
}
return null;
}
開發者ID:mthizo247,項目名稱:spring-cloud-netflix-zuul-websocket,代碼行數:16,
示例5: executeLocalJobs
點讚 2
import org.springframework.util.PatternMatchUtils; //導入方法依賴的package包/類
private void executeLocalJobs(JobParameters jobParameters)
throws JobExecutionException {
for (Job job : this.jobs) {
if (StringUtils.hasText(this.jobNames)) {
String[] jobsToRun = this.jobNames.split(",");
if (!PatternMatchUtils.simpleMatch(jobsToRun, job.getName())) {
logger.debug("Skipped job: " + job.getName());
continue;
}
}
execute(job, jobParameters);
}
}