java ismatch_Java PatternMatchUtils.simpleMatch方法代碼示例

本文详细介绍了Java中org.springframework.util.PatternMatchUtils.simpleMatch方法的使用,包括多个实际代码示例,涵盖了该方法在不同场景下的应用,如在数据库错误码匹配、WebSocket路径匹配、图片查找、触发器配置筛选等方面的应用。
摘要由CSDN通过智能技术生成

本文整理匯總了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);

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值