All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jfaster.mango.binding.InvocationContextFactory Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
package org.jfaster.mango.binding;

/**
 * @author ash
 */
public class InvocationContextFactory {

  private ParameterContext parameterContext;

  private InvocationContextFactory(ParameterContext parameterContext) {
    this.parameterContext = parameterContext;
  }

  public static InvocationContextFactory create(ParameterContext parameterContext) {
    return new InvocationContextFactory(parameterContext);
  }

  public InvocationContext newInvocationContext(Object[] values) {
    InvocationContext context = DefaultInvocationContext.create();
    for (int i = 0; i < values.length; i++) {
      String parameterName = parameterContext.getParameterNameByPosition(i);
      context.addParameter(parameterName, values[i]);
    }
    return context;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy