}
public Collection<RuleSolution> resolveAllPaths(String ruleName, String category) {
// I don't want duplicates so the HashSet
Collection<RuleSolution> result = new HashSet<RuleSolution>();
Rule rule = _project.getRepository().getRule(ruleName);
if (rule == null) {
throw new IllegalArgumentException("Cannot find rule " + ruleName);
}
String categorizedRule = ruleName + (category == null ? "" : "(" + category + ")");
// I build a String like a properties file with var.name=temply expression to get the value
StringBuffer in = new StringBuffer();
for (Var var : rule.getVars()) {
in.append(var.getName()).append("=$temply{").append(categorizedRule).append(":").append(var.getName()).append("}").append("\n");
}
// then I resolve all paths
// InputNode inputNode = new InputNode(_project.getRepository(), _rules, in.toString(), _forcedCategories,
// _forcedPaths);
Collection<List<PathEntry>> paths = getPaths(in.toString());
for (List<PathEntry> path : paths) {
Properties prop = new Properties();
try {
// I resolve the path and put it in a properties
prop.load(new StringReader(resolvePath(in.toString(), path)));
} catch (IOException e) {
throw new RuntimeException(e);
}
// then I read the properties and put them in the result
RuleValue value = new RuleValue();
for (Var var : rule.getVars()) {
value.put(var.getName(), prop.getProperty(var.getName()));
}
result.add(new RuleSolution(value, path));
}
return result;