use of org.kie.internal.builder.ResultSeverity in project drools by kiegroup.
the class KnowledgeBuilderConfigurationImpl method getProperty.
public String getProperty(String name) {
name = name.trim();
if (StringUtils.isEmpty(name)) {
return null;
}
if (name.equals(DefaultDialectOption.PROPERTY_NAME)) {
return getDefaultDialect();
} else if (name.equals(DefaultPackageNameOption.PROPERTY_NAME)) {
return getDefaultPackageName();
} else if (name.startsWith(AccumulateFunctionOption.PROPERTY_NAME)) {
int index = AccumulateFunctionOption.PROPERTY_NAME.length();
AccumulateFunction function = this.accumulateFunctions.get(name.substring(index));
return function != null ? function.getClass().getName() : null;
} else if (name.startsWith(EvaluatorOption.PROPERTY_NAME)) {
String key = name.substring(name.lastIndexOf('.') + 1);
EvaluatorDefinition evalDef = this.evaluatorRegistry.getEvaluatorDefinition(key);
return evalDef != null ? evalDef.getClass().getName() : null;
} else if (name.equals(DumpDirOption.PROPERTY_NAME)) {
return this.dumpDirectory != null ? this.dumpDirectory.toString() : null;
} else if (name.equals(ProcessStringEscapesOption.PROPERTY_NAME)) {
return String.valueOf(isProcessStringEscapes());
} else if (name.equals(ClassLoaderCacheOption.PROPERTY_NAME)) {
return String.valueOf(isClassLoaderCacheEnabled());
} else if (name.startsWith(KBuilderSeverityOption.PROPERTY_NAME)) {
String key = name.substring(name.lastIndexOf('.') + 1);
ResultSeverity severity = this.severityMap.get(key);
return severity.toString();
} else if (name.equals(LanguageLevelOption.PROPERTY_NAME)) {
return "" + getLanguageLevel();
}
return null;
}
use of org.kie.internal.builder.ResultSeverity in project drools by kiegroup.
the class KnowledgeBuilderImpl method getResultList.
private List<KnowledgeBuilderResult> getResultList(ResultSeverity... severities) {
List<ResultSeverity> typesToFetch = Arrays.asList(severities);
ArrayList<KnowledgeBuilderResult> problems = new ArrayList<KnowledgeBuilderResult>();
for (KnowledgeBuilderResult problem : results) {
if (typesToFetch.contains(problem.getSeverity())) {
problems.add(problem);
}
}
return problems;
}
Aggregations