src/main/java/org/ucmtwine/parameter/ParameterMarshaller.java
public Object[] getValueArray(Object[] arguments, Service service) {
    Object[] paramArray = new Object[this.parameters.size()];

    int argumentIndex = 0;

    for (int i = 0; i < this.parameters.size(); i++) {

      // inject params if needed
      IParameter p = this.parameters.get(i);

      try {

        if (p instanceof InjectedParameter) {
          paramArray[i] = p.getArgumentValue(null, service);
        } else {
          paramArray[i] = p.getArgumentValue(arguments[argumentIndex], service);
          argumentIndex++;
        }

      } catch (ClassCastException e) {
        SystemUtils.trace("twine", "getArgumentValue failed on parameter " + (i + 1) + ": " + e.getMessage());
      }

    }

    return paramArray;
  }
public Object[] getValueArray(Object[] arguments, Service service) {
    Object[] paramArray = new Object[this.parameters.size()];

    int argumentIndex = 0;

    for (int i = 0; i < this.parameters.size(); i++) {

      // inject params if needed
      IParameter p = this.parameters.get(i);

      try {

        if (p instanceof InjectedParameter) {
          paramArray[i] = p.getArgumentValue(null, service);
        } else {
          paramArray[i] = p.getArgumentValue(arguments[argumentIndex], service);
          argumentIndex++;
        }

      } catch (ClassCastException e) {
        SystemUtils.trace("twine", "getArgumentValue failed on parameter " + (i + 1) + ": " + e.getMessage());
      }

    }

    return paramArray;
  }
public Object [ ] getValueArray ( Object [ ] arguments , Service service ) { Object [ ] paramArray = new Object [ this . parameters . size ( ) ] ; int argumentIndex = 0 ; for ( int i = 0 ; i < this . parameters . size ( ) ; i ++ ) { // inject params if needed IParameter p = this . parameters . get ( i ) ; try { if ( p instanceof InjectedParameter ) { paramArray [ i ] = p . getArgumentValue ( null , service ) ; } else { paramArray [ i ] = p . getArgumentValue ( arguments [ argumentIndex ] , service ) ; argumentIndex ++ ; } } catch ( ClassCastException e ) { SystemUtils . trace ( "twine" , "getArgumentValue failed on parameter " + ( i + 1 ) + ": " + e . getMessage ( ) ) ; } } return paramArray ; }
Returns an array of values given an array of script arguments for use with
the reflection method.invoke(), injecting known service/user/context data.

@return
@throws IllegalAccessException
Returns an array of values given an array of script arguments for use with the reflection method . invoke () injecting known service / user / context data .