Function f = factory.function(IsInstanceOf.NAME.getFunctionName(), args, null); assertNotNull(f); f = factory.function(IsInstanceOf.NAME.getName(), args, null); assertNotNull(f); f = factory.function(IsInstanceOf.NAME.getName(), args, null); } catch (IllegalArgumentException e) { catchedException = true; try { f = factory.function(IsInstanceOf.NAME.getName(), null, null); } catch (NullPointerException e) { catchedException = true;
Function findFunctionInternal(Name name, List parameters, Literal fallback) { if (functionFactoryCache == null) { synchronized (this) { if (functionFactoryCache == null) { functionFactoryCache = lookupFunctions(); } } } if (functionFactoryCache.containsKey(name)) { FunctionFactory functionFactory = functionFactoryCache.get(name); return functionFactory.function(name, parameters, fallback); } // do a lookup from all factories, this is because of the name tricks the default // factory does Function f = null; for (FunctionFactory ff : CommonFactoryFinder.getFunctionFactories(null)) { f = ff.function(name, parameters, fallback); if (f != null) return f; } return null; }
processArgs.add(outputHeight); Function function = functionFactory.function(processName(name), processArgs, null); return function;
@Test public void testLookup() { Set<FunctionFactory> factories = CommonFactoryFinder.getFunctionFactories(null); FunctionFactory factory = null; for (FunctionFactory ff : factories) { for (FunctionName fn : ff.getFunctionNames()) { if ("foo".equals(fn.getName())) { factory = ff; break; } } } assertNotNull(factory); Function f = factory.function("foo", null, null); assertNotNull(f); }
Function findFunctionInternal(Name name, List parameters, Literal fallback) { if (functionFactoryCache == null) { synchronized (this) { if (functionFactoryCache == null) { functionFactoryCache = lookupFunctions(); } } } if (functionFactoryCache.containsKey(name)) { FunctionFactory functionFactory = functionFactoryCache.get(name); return functionFactory.function(name, parameters, fallback); } //do a lookup from all factories, this is because of the name tricks the default // factory does Function f = null; for (FunctionFactory ff : CommonFactoryFinder.getFunctionFactories(null)) { f = ff.function(name, parameters, fallback); if (f != null) return f; } return null; }
processArgs.add(outputHeight); Function function = functionFactory.function(processName(name), processArgs, null); return function;