* Private helper that handles the combiningAlgFactory elements.
*/
private CombiningAlgFactory parseCombiningAlgFactory(Node root)
throws ParsingException
{
CombiningAlgFactory factory = null;
// check if we're starting with the standard factory setup
if (useStandard(root, "useStandardAlgorithms")) {
logger.config("Starting with standard Combining Algorithms");
factory = StandardCombiningAlgFactory.getNewFactory();
} else {
factory = new BaseCombiningAlgFactory();
}
// now look for all algorithms specified for this factory, adding
// them as we go
NodeList children = root.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node child = children.item(i);
if (SunxacmlUtil.getNodeName(child).equals("algorithm")) {
// an algorithm is a simple class element
CombiningAlgorithm alg =
(CombiningAlgorithm)(loadClass("algorithm", child));
try {
factory.addAlgorithm(alg);
} catch (IllegalArgumentException iae) {
throw new ParsingException("duplicate combining " +
"algorithm: " +
alg.getIdentifier().toString(),
iae);