switch (c.getType()) {
case attribute:
attributes.add(c.getExpression());
break;
case date:
rules.addOracleComparator(new OracleComparator(c.getType().toString()
+ c.getExpression(), new DateComparator()));
break;
case regex:
regexs.add(c.getExpression());
break;
case script:
rules.addOracleComparator(new OracleComparator(c.getType().toString()
+ c.getExpression(), new ScriptComparator()));
break;
case distance:
rules.addOracleComparator(new OracleComparator(c.getType().toString()
+ c.getExpression(), new EditDistanceComparator(Double
.parseDouble(c.getExpression()))));
break;
case simple:
rules.addOracleComparator(new OracleComparator(c.getType().toString()
+ c.getExpression(), new SimpleComparator()));
break;
case plain:
rules.addOracleComparator(new OracleComparator(c.getType().toString()
+ c.getExpression(), new PlainStructureComparator()));
break;
case style:
rules.addOracleComparator(new OracleComparator(c.getType().toString()
+ c.getExpression(), new StyleComparator()));
break;
case xpath:
xpaths.add(c.getExpression());
break;
}
}
// create collection comparators
if (attributes.size() > 0)
rules.addOracleComparator(new OracleComparator(
"attribute",
new AttributeComparator(attributes.toArray(new String[attributes.size()]))));
if (regexs.size() > 0)
rules.addOracleComparator(new OracleComparator("regex", new RegexComparator(
regexs.toArray(new String[regexs.size()]))));
if (xpaths.size() > 0)
rules.addOracleComparator(new OracleComparator("xpath",
new XPathExpressionComparator(xpaths.toArray(new String[xpaths.size()]))));
}