/* (non-Javadoc)
@see javax.el.FunctionMapper#resolveFunction(java.lang.String, java.lang.String)
180919
@Override
    public Method resolveFunction(String prefix, String localName) {
        if (this.memento == null) {
            this.memento = new FunctionMapperImpl();
        }
        Method m = this.target.resolveFunction(prefix, localName);
        if (m != null) {
            this.memento.mapFunction(prefix, localName, m);
        }
        return m;
    }
609372
public static Method getFunction(String functionName) {
    return functionMap.get("sql" + functionName.toLowerCase(Locale.US));
  }
1050603
@Override
    public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) throws SQLException
    {
        checkClosed();
        throw SQLError.noSupport();
    }
1323849
public void setFilter(Function<String, String> filterFunction)
	{
		this.filterFunction = filterFunction;
		this.text = new StringBuilder(this.filterFunction.apply(this.text.toString()));
	}
1353974
private static BiFunction<AnnotatedValueResolver, ResolverContext, Object>
    resolver(Function<ResolverContext, String> getter) {
        return (resolver, ctx) -> resolver.convert(getter.apply(ctx));
    }
510624
public void addResolvedFrom(Context context) {
    context.getResolvedExpressions().forEach(this::addResolvedExpression);
    context.getResolvedFunctions().forEach(this::addResolvedFunction);
    context.getResolvedValues().forEach(this::addResolvedValue);
  }
769218
public Object getFunctionsValue(String parameter, String function){
        
        Object value=null;
        return value;
    }
382586
public void resolvePropertiesFromSameDiffBeforeExecution() {
        val properties = sameDiff.propertiesToResolveForFunction(this);
        val fields = DifferentialFunctionClassHolder.getInstance().getFieldsForFunction(this);
        val currentFields = this.propertiesForFunction();

        for(val property : properties) {
            //property maybe a variable which is only an array
            //just skip  if this is the case
            if(!fields.containsKey(property))
                continue;

            val var = sameDiff.getVarNameForFieldAndFunction(this,property);
            val fieldType = fields.get(property);
            val varArr = sameDiff.getArrForVarName(var);
            //already defined
            if(currentFields.containsKey(property)) {
                continue;
            }

            /**
             * Possible cause:
             * Might be related to output name alignment.
             *
             */
            if(varArr == null) {
                throw new ND4JIllegalStateException("Unable to set null array!");
            }

            if(fieldType.getType().equals(int[].class)) {
                setValueFor(fieldType,varArr.data().asInt());
            }

            else if(fieldType.equals(double[].class)) {
                setValueFor(fieldType,varArr.data().asDouble());
            }

            else if(fieldType.equals(int.class)) {
                setValueFor(fieldType,varArr.getInt(0));
            }

            else if(fieldType.equals(double.class)) {
                setValueFor(fieldType,varArr.getDouble(0));
            }

        }

    }
503274
@Override
  protected void visitFunctionNode(FunctionNode node) {

    // Cannot simplify nonplugin functions.
    // TODO(brndn): we can actually simplify checkNotNull.
    if (node.getSoyFunction() instanceof BuiltinFunction) {
      return;
    }
    if (node.getSoyFunction() instanceof LoggingFunction) {
      return;
    }
    // Default to fallback implementation.
    visitExprNode(node);
  }
181211
static
	public void putFunction(String name, Function function){
		FunctionRegistry.functions.put(Objects.requireNonNull(name), function);
	}
1293715
@Override
    public String resolve(String code, Object... arguments) {
        return this.messageSourceAccessor.getMessage(code, arguments, code);
    }
288685
public Bindings bind(FunctionMapper fnMapper, VariableMapper varMapper, TypeConverter converter) {
		Method[] methods = null;
		if (!functions.isEmpty()) {
			if (fnMapper == null) {
				throw new ELException(LocalMessages.get("error.function.nomapper"));
			}
			methods = new Method[functions.size()];
			for (int i = 0; i < functions.size(); i++) {
				FunctionNode node = functions.get(i);
				String image = node.getName();
				Method method = null;
				int colon = image.indexOf(':');
				if (colon < 0) {
					method = fnMapper.resolveFunction("", image);
				} else {
					method = fnMapper.resolveFunction(image.substring(0, colon), image.substring(colon + 1));
				}
				if (method == null) {
					throw new ELException(LocalMessages.get("error.function.notfound", image));
				}
				if (node.isVarArgs() && method.isVarArgs()) {
					if (method.getParameterTypes().length > node.getParamCount() + 1) {
						throw new ELException(LocalMessages.get("error.function.params", image));
					}
				} else {
					if (method.getParameterTypes().length != node.getParamCount()) {
						throw new ELException(LocalMessages.get("error.function.params", image));
					}
				}
				methods[node.getIndex()] = method;
			}
		}
		ValueExpression[] expressions = null;
		if (identifiers.size() > 0) {
			expressions = new ValueExpression[identifiers.size()];
			for (int i = 0; i < identifiers.size(); i++) {
				IdentifierNode node = identifiers.get(i);
				ValueExpression expression = null;
				if (varMapper != null) {
					expression = varMapper.resolveVariable(node.getName());
				}
				expressions[node.getIndex()] = expression;
			}
		}
		return new Bindings(methods, expressions, converter);
	}
362224
public void defineFunction(String prefix, String function, Method method)
            throws java.lang.NoSuchMethodException {

        if (prefix == null || function == null || method == null) {
            throw new NullPointerException(Util.message(
                    context, "elProcessor.defineFunctionNullParams"));
        }

        int modifiers = method.getModifiers();

        // Check for public method as well as being static
        if (!Modifier.isStatic(modifiers) || !Modifier.isPublic(modifiers)) {
            throw new NoSuchMethodException(Util.message(context,
                    "elProcessor.defineFunctionInvalidMethod", method.getName(),
                    method.getDeclaringClass().getName()));
        }

        manager.mapFunction(prefix, function, method);
    }
278945
@Override
    public <T> Expression<T> function(String arg0, Class<T> arg1, Expression<?>... arg2)
    {
        // TODO Auto-generated method stub
        return null;
    }
404320
public static String resolveFunction(String functionString, TestContext context) {
        String functionExpression = VariableUtils.cutOffVariablesPrefix(functionString);

        if (!functionExpression.contains("(") || !functionExpression.endsWith(")") || !functionExpression.contains(":")) {
            throw new InvalidFunctionUsageException("Unable to resolve function: " + functionExpression);
        }
        
        String functionPrefix = functionExpression.substring(0, functionExpression.indexOf(':') + 1);
        String parameterString = functionExpression.substring(functionExpression.indexOf('(') + 1, functionExpression.length() - 1);
        String function = functionExpression.substring(functionPrefix.length(), functionExpression.indexOf('('));

        FunctionLibrary library = context.getFunctionRegistry().getLibraryForPrefix(functionPrefix);

        parameterString = VariableUtils.replaceVariablesInString(parameterString, context, false);
        parameterString = replaceFunctionsInString(parameterString, context);

        String value = library.getFunction(function).execute(FunctionParameterHelper.getParameterList(parameterString), context);

        if (value == null) {
            return "";
        } else {
            return value;
        }
    }
6990
protected String resolveFunctionName(Environment env) {
        return env.getProperty(LocalFunctionRegistry.FUNCTION_NAME, String.class, (String) null);
    }
504778
public void setFunctions(java.util.Collection<FunctionConfiguration> functions) {
        if (functions == null) {
            this.functions = null;
            return;
        }

        this.functions = new java.util.ArrayList<FunctionConfiguration>(functions);
    }