本文整理汇总了Java中org.springframework.util.PatternMatchUtils.simpleMatch方法的典型用法代码示例。如果您正苦于以下问题:Java PatternMatchUtils.simpleMatch方法的具体用法?Java PatternMatchUtils.simpleMatch怎么用?Java PatternMatchUtils.simpleMatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.util.PatternMatchUtils
的用法示例。
在下文中一共展示了PatternMatchUtils.simpleMatch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWebSocketBrokarage
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<String, ZuulWebSocketProperties.WsBrokerage> 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;
}
示例2: findImage
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;
}
示例3: matches
import org.springframework.util.PatternMatchUtils; //导入方法依赖的package包/类
public boolean matches(String application, String profile, String label) {
if (this.pattern == null || this.pattern.length == 0) {
return false;
}
String[] profiles = StringUtils.commaDelimitedListToStringArray(profile);
for (int i = profiles.length; i-- > 0;) {
if (PatternMatchUtils.simpleMatch(this.pattern,
application + "/" + profiles[i])) {
return true;
}
}
return false;
}
示例4: getErrorCodes
import org.springframework.util.PatternMatchUtils; //导入方法依赖的package包/类
/**
* Return the {@link SQLErrorCodes} instance for the given database.
* <p>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();
}
示例5: getWebSocketServerPath
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;
}
示例6: executeLocalJobs
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);
}
}
示例7: innerTest
import org.springframework.util.PatternMatchUtils; //导入方法依赖的package包/类
@Override
protected boolean innerTest(CharSequence text) {
if(text == null) {
//obviously that '*' math null strings too
return "*".equals(pattern);
}
return PatternMatchUtils.simpleMatch(pattern, text.toString());
}
示例8: hasAtLeastOneAnnotation
import org.springframework.util.PatternMatchUtils; //导入方法依赖的package包/类
/**
* Determine if an {@link AnnotatedNode} has one or more of the specified annotations.
* N.B. the annotation type names are not normally fully qualified.
* @param node the node to examine
* @param annotations the annotations to look for
* @return {@code true} if at least one of the annotations is found, otherwise
* {@code false}
*/
public static boolean hasAtLeastOneAnnotation(AnnotatedNode node,
String... annotations) {
for (AnnotationNode annotationNode : node.getAnnotations()) {
for (String annotation : annotations) {
if (PatternMatchUtils.simpleMatch(annotation,
annotationNode.getClassNode().getName())) {
return true;
}
}
}
return false;
}
示例9: findTrigger
import org.springframework.util.PatternMatchUtils; //导入方法依赖的package包/类
/**
* Find a matching trigger configuration.
* @param name the bean name to match
* @return a matching configuration if there is one
*/
public TriggerProperties findTrigger(String name) {
for (SpecificTriggerProperties value : this.triggers.values()) {
if (PatternMatchUtils.simpleMatch(value.getNames(), name)) {
return value;
}
}
return this;
}
示例10: isMatch
import org.springframework.util.PatternMatchUtils; //导入方法依赖的package包/类
private boolean isMatch(Metric<?> metric) {
String[] includes = MetricCopyExporter.this.includes;
String[] excludes = MetricCopyExporter.this.excludes;
String name = metric.getName();
if (ObjectUtils.isEmpty(includes)
|| PatternMatchUtils.simpleMatch(includes, name)) {
return !PatternMatchUtils.simpleMatch(excludes, name);
}
return false;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:11,代码来源:MetricCopyExporter.java
示例11: filter
import org.springframework.util.PatternMatchUtils; //导入方法依赖的package包/类
private List<Server> filter(List<Server> servers, String pattern) {
List<Server> filtered = new ArrayList<>();
for (Server server : servers) {
if (PatternMatchUtils.simpleMatch(pattern, server.getId())) {
filtered.add(server);
}
}
return filtered;
}
示例12: filter
import org.springframework.util.PatternMatchUtils; //导入方法依赖的package包/类
private Server filter(String pattern) {
if (StringUtils.hasText(pattern)) {
List<Server> servers = getServerList(true);
for (Server server : servers) {
if (PatternMatchUtils.simpleMatch(pattern, server.getId())) {
return server;
}
}
}
return null;
}
示例13: isMatch
import org.springframework.util.PatternMatchUtils; //导入方法依赖的package包/类
private boolean isMatch(String name, String[] includes, String[] excludes) {
if (ObjectUtils.isEmpty(includes)
|| PatternMatchUtils.simpleMatch(includes, name)) {
return !PatternMatchUtils.simpleMatch(excludes, name);
}
return false;
}
示例14: isMatch
import org.springframework.util.PatternMatchUtils; //导入方法依赖的package包/类
/**
* Copy of similarly named method in {@link MetricCopyExporter}.
*/
private boolean isMatch(String name, String[] includes, String[] excludes) {
if (ObjectUtils.isEmpty(includes)
|| PatternMatchUtils.simpleMatch(includes, name)) {
return !PatternMatchUtils.simpleMatch(excludes, name);
}
return false;
}
示例15: isTransport
import org.springframework.util.PatternMatchUtils; //导入方法依赖的package包/类
static boolean isTransport(ClassNode node, String type) {
for (AnnotationNode annotationNode : node.getAnnotations()) {
String annotation = "EnableBinding";
if (PatternMatchUtils.simpleMatch(annotation,
annotationNode.getClassNode().getName())) {
Expression expression = annotationNode.getMembers().get("transport");
String transport = expression == null ? "rabbit" : expression.getText();
if (transport != null) {
transport = SystemPropertyUtils.resolvePlaceholders(transport);
}
return transport.equals(type);
}
}
return false;
}