本文整理了Java中org.kie.workbench.common.services.shared.whitelist.WhiteList.add()
方法的一些代码示例,展示了WhiteList.add()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WhiteList.add()
方法的具体详情如下:
包路径:org.kie.workbench.common.services.shared.whitelist.WhiteList
类名称:WhiteList
方法名:add
暂无
代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend
/**
* @return Package Names matching the White List to the available packages
*/
public WhiteList getFilteredPackageNames() {
final WhiteList whiteList = new WhiteList();
final Map<String, String> packageNamePatterns = getPatterns();
for (String pattern : patterns) {
for (Map.Entry<String, String> packageNamePath : packageNamePatterns.entrySet()) {
if (ANT_PATH_MATCHER.match(pattern,
packageNamePath.getValue())) {
whiteList.add(packageNamePath.getKey());
}
}
}
return whiteList;
}
代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend
whiteList.add( "org.drools" );
whiteList.add( "org.guvnor" );
final Metadata metadata = new Metadata();
final String comment = "comment";
代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend
@Test
public void testVerifyClass(){
WhiteList whiteList = new WhiteList();
whiteList.add("org.kie.workbench.common.services.backend.builder");
ClassVerifier classVerifier = new ClassVerifier(kieModuleMetaData, typeSourceResolver);
List<BuildMessage> messages = classVerifier.verify(whiteList);
assertEquals(messages.size(), 1);
assertEquals("Verification of class org.kie.workbench.common.services.backend.builder.SomeClass failed and will not be available for authoring.\n"
+ "Underlying system error is: The access to the class is not allowed. Please check the necessary external dependencies for this project are configured correctly.",
messages.get(0).getText());
}
}
代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend
/**
* Filter the provided Package names by the Module's white list
* @param module Module for which to filter Package names
* @param packageNames All Package names in the Module
* @return A filtered collection of Package names
*/
@Override
public WhiteList filterPackageNames(final Module module,
final Collection<String> packageNames) {
if (packageNames == null) {
return new WhiteList();
} else if (module instanceof KieModule) {
final WhiteList whiteList = load(((KieModule) module).getPackageNamesWhiteListPath());
if (whiteList.isEmpty()) {
return new WhiteList(packageNames);
} else {
for (Package aPackage : moduleService.resolvePackages(module)) {
whiteList.add(aPackage.getPackageName());
}
return new PackageNameWhiteListFilter(packageNames,
whiteList).getFilteredPackageNames();
}
} else {
return new WhiteList(packageNames);
}
}
代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-api
@Test
public void testContainsAny() throws Exception {
final WhiteList whiteList = new WhiteList();
assertFalse( whiteList.containsAny( getSet() ) );
assertFalse( whiteList.containsAny( getSet( "org.test" ) ) );
whiteList.add( "org.something" );
assertFalse( whiteList.containsAny( getSet( "org.test" ) ) );
whiteList.add( "org.test" );
assertTrue( whiteList.containsAny( getSet( "org.test" ) ) );
}
内容来源于网络,如有侵权,请联系作者删除!