* @param loc the locator used to load taglib
* @since 5.0.0
*/
public static final FunctionMapper getFunctionMapper(Collection taglibs,
Map imports, Collection funcs, Locator loc) {
TaglibMapper mapper = null;
if (taglibs != null && !taglibs.isEmpty()) {
mapper = new TaglibMapper();
for (Iterator it = taglibs.iterator(); it.hasNext();)
mapper.load((Taglib)it.next(), loc);
}
if (imports != null && !imports.isEmpty()) {
if (mapper == null)
mapper = new TaglibMapper();
for (Iterator it = imports.entrySet().iterator(); it.hasNext();) {
final Map.Entry me = (Map.Entry)it.next();
mapper.addClass((String)me.getKey(), (Class)me.getValue());
}
}
if (funcs != null && !funcs.isEmpty()) {
if (mapper == null)
mapper = new TaglibMapper();
for (Iterator it = funcs.iterator(); it.hasNext();) {
final Object[] o = (Object[])it.next();
mapper.addFunction(
(String)o[0], (String)o[1], (Function)o[2]);
}
}
return mapper;
}