src/main/java/com/virgo47/vexpressed/support/FunctionMapper.java
public FunctionMapper registerFunction(
		String functionName, Object delegate, String methodName, Class<?>... parameterTypes)
	{
		checkThatNotFinished();

		try {
			Class<?> delegateClass = delegate.getClass();
			if (delegate instanceof Class) {
				delegateClass = (Class) delegate;
				delegate = null;
			}
			Method method = delegateClass.getDeclaredMethod(methodName, parameterTypes);
			methodMap.put(functionName, createMethodInfo(delegate, method));
		} catch (NoSuchMethodException e) {
			throw new IllegalArgumentException(
				"Invalid method specified for function " + functionName, e);
		}
		return this;
	}
/**
	 * Explicitly adds method from delegate object to the function to method map. Can be also
	 * called with a class object, in which case delegate object is null, but can be used for
	 * functions implemented by static methods.
	 */
Explicitly adds method from delegate object to the function to method map. Can be also
called with a class object, in which case delegate object is null, but can be used for
functions implemented by static methods.
Explicitly adds method from delegate object to the function to method map . Can be also called with a class object in which case delegate object is null but can be used for functions implemented by static methods .
public FunctionMapper registerFunction(
		String functionName, Object delegate, String methodName, Class<?>... parameterTypes)
	{
		checkThatNotFinished();
		try {
			Class<?> delegateClass = delegate.getClass();
			if (delegate instanceof Class) {
				delegateClass = (Class) delegate;
				delegate = null;
			}
			Method method = delegateClass.getDeclaredMethod(methodName, parameterTypes);
			methodMap.put(functionName, createMethodInfo(delegate, method));
		} catch (NoSuchMethodException e) {
			throw new IllegalArgumentException(
				"Invalid method specified for function " + functionName, e);
		}
		return this;
	}
public FunctionMapper registerFunction ( String functionName , Object delegate , String methodName , Class < ? > ... parameterTypes ) { checkThatNotFinished ( ) ; try { Class < ? > delegateClass = delegate . getClass ( ) ; if ( delegate instanceof Class ) { delegateClass = ( Class ) delegate ; delegate = null ; } Method method = delegateClass . getDeclaredMethod ( methodName , parameterTypes ) ; methodMap . put ( functionName , createMethodInfo ( delegate , method ) ) ; } catch ( NoSuchMethodException e ) { throw new IllegalArgumentException ( "Invalid method specified for function " + functionName , e ) ; } return this ; }
Explicitly adds method from delegate object to the function to method map.
Explicitly adds method from delegate object to the function to method map .