/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see .
*/
package org.alfresco.repo.template;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.xml.dtm.ref.DTMNodeProxy;
import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
import org.w3c.dom.traversal.NodeFilter;
import org.w3c.dom.traversal.NodeIterator;
/**
* @author Brian
*
*/
public class XSLTProcessorMethodInvoker
{
private final static Log log = LogFactory.getLog(XSLTProcessorMethodInvoker.class);
private final static Map PROCESSOR_METHODS = new TreeMap();
public XSLTProcessorMethodInvoker()
{
}
public static void addMethod(String name, TemplateProcessorMethod method)
{
PROCESSOR_METHODS.put(name, method);
}
public static void removeMethods(Collection methodNames)
{
for (String methodName : methodNames)
{
PROCESSOR_METHODS.remove(methodName);
}
}
private Object[] convertArguments(final Object[] arguments)
{
final List