本文整理了Java中org.crsh.util.Utils.globexToRegex()
方法的一些代码示例,展示了Utils.globexToRegex()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.globexToRegex()
方法的具体详情如下:
包路径:org.crsh.util.Utils
类名称:Utils
方法名:globexToRegex
[英]Create a pattern that transforms a glob expression into a regular expression, the following task are supported
代码示例来源:origin: crashub/crash
public static List<BindingRenderer.BindingData> lookup(List<String> filters, String name, Boolean verbose) {
Pattern pattern = null;
if (name != null) {
pattern = Pattern.compile("^" + Utils.globexToRegex(name) + "$");
}
List<BindingRenderer.BindingData> data = new ArrayList<BindingRenderer.BindingData>();
data.addAll(get(filters, pattern, verbose, ""));
data.addAll(get(filters, pattern, verbose, "java:/"));
data.addAll(get(filters, pattern, verbose, "java:comp/env/jdbc"));
data.addAll(get(filters, pattern, verbose, "java:jboss"));
data.addAll(get(filters, pattern, verbose, "java:global"));
data.addAll(get(filters, pattern, verbose, "java:app"));
data.addAll(get(filters, pattern, verbose, "java:module"));
return data;
}
代码示例来源:origin: crashub/crash
private void assertNotMatchGlob(String test, String globex) {
Pattern p = Pattern.compile("^" + Utils.globexToRegex(globex) + "$");
Matcher matcher = p.matcher(test);
assertFalse("Was expecting " + test + " to not match " + globex, matcher.matches());
}
代码示例来源:origin: crashub/crash
private void assertMatchGlob(String test, String globex) {
Pattern p = Pattern.compile("^" + Utils.globexToRegex(globex) + "$");
Matcher matcher = p.matcher(test);
assertTrue("Was expecting " + test + " to match " + globex, matcher.matches());
}
代码示例来源:origin: org.crsh/crsh.shell.core
public static List<BindingRenderable.BindingData> lookup(List<String> filters, String name, Boolean verbose) {
Pattern pattern = null;
if (name != null) {
pattern = Pattern.compile("^" + Utils.globexToRegex(name) + "$");
}
List<BindingRenderable.BindingData> data = new ArrayList<BindingRenderable.BindingData>();
data.addAll(get(filters, pattern, verbose, ""));
data.addAll(get(filters, pattern, verbose, "java:/"));
data.addAll(get(filters, pattern, verbose, "java:comp/env/jdbc"));
data.addAll(get(filters, pattern, verbose, "java:jboss"));
data.addAll(get(filters, pattern, verbose, "java:global"));
data.addAll(get(filters, pattern, verbose, "java:app"));
data.addAll(get(filters, pattern, verbose, "java:module"));
return data;
}
代码示例来源:origin: org.crashub/crash.shell
public static List<BindingRenderer.BindingData> lookup(List<String> filters, String name, Boolean verbose) {
Pattern pattern = null;
if (name != null) {
pattern = Pattern.compile("^" + Utils.globexToRegex(name) + "$");
}
List<BindingRenderer.BindingData> data = new ArrayList<BindingRenderer.BindingData>();
data.addAll(get(filters, pattern, verbose, ""));
data.addAll(get(filters, pattern, verbose, "java:/"));
data.addAll(get(filters, pattern, verbose, "java:comp/env/jdbc"));
data.addAll(get(filters, pattern, verbose, "java:jboss"));
data.addAll(get(filters, pattern, verbose, "java:global"));
data.addAll(get(filters, pattern, verbose, "java:app"));
data.addAll(get(filters, pattern, verbose, "java:module"));
return data;
}
代码示例来源:origin: com.github.corda.crash/crash.shell
public static List<BindingRenderer.BindingData> lookup(List<String> filters, String name, Boolean verbose) {
Pattern pattern = null;
if (name != null) {
pattern = Pattern.compile("^" + Utils.globexToRegex(name) + "$");
}
List<BindingRenderer.BindingData> data = new ArrayList<BindingRenderer.BindingData>();
data.addAll(get(filters, pattern, verbose, ""));
data.addAll(get(filters, pattern, verbose, "java:/"));
data.addAll(get(filters, pattern, verbose, "java:comp/env/jdbc"));
data.addAll(get(filters, pattern, verbose, "java:jboss"));
data.addAll(get(filters, pattern, verbose, "java:global"));
data.addAll(get(filters, pattern, verbose, "java:app"));
data.addAll(get(filters, pattern, verbose, "java:module"));
return data;
}
内容来源于网络,如有侵权,请联系作者删除!