jodd-madvoc/src/main/java/jodd/madvoc/config/Targets.java
protected Target[] makeTargets(final Target actionTarget, final MethodParam[] methodParams) {
		if (methodParams == null) {
			// action does not have method parameters, so there is just one target
			return new Target[]{actionTarget};
		}

		// action has method arguments, so there is more then one target
		final Target[] target = new Target[methodParams.length + 1];
		target[0] = actionTarget;

		final Object action = actionTarget.value();

		for (int i = 0; i < methodParams.length; i++) {
			final MethodParam methodParam = methodParams[i];
			final Class paramType = methodParam.type();

			final Target paramTarget;

			if (methodParam.annotationType() == null) {
				// parameter is NOT annotated, create new value for the target
				// the class itself will be a base class, and should be scanned

				final ScopeData newScopeData = methodParam.scopeData().inspector().inspectClassScopesWithCache(paramType);
				paramTarget = Target.ofValue(createActionMethodArgument(paramType, action), newScopeData);
			}
			else if (methodParam.annotationType() == Out.class) {
				// parameter is annotated with *only* OUT annotation
				// create the output value now AND to save the type
				paramTarget = Target.ofMethodParam(methodParam, createActionMethodArgument(paramType, action));
			}
			else {
				// parameter is annotated with any IN annotation
				// create target with NO value, as the value will be created later
				paramTarget = Target.ofMethodParam(methodParam, type -> createActionMethodArgument(type, action));
			}

			target[i + 1] = paramTarget;
		}
		return target;
	}
protected Target[] makeTargets(final Target actionTarget, final MethodParam[] methodParams) {
		if (methodParams == null) {
			// action does not have method parameters, so there is just one target
			return new Target[]{actionTarget};
		}

		// action has method arguments, so there is more then one target
		final Target[] target = new Target[methodParams.length + 1];
		target[0] = actionTarget;

		final Object action = actionTarget.value();

		for (int i = 0; i < methodParams.length; i++) {
			final MethodParam methodParam = methodParams[i];
			final Class paramType = methodParam.type();

			final Target paramTarget;

			if (methodParam.annotationType() == null) {
				// parameter is NOT annotated, create new value for the target
				// the class itself will be a base class, and should be scanned

				final ScopeData newScopeData = methodParam.scopeData().inspector().inspectClassScopesWithCache(paramType);
				paramTarget = Target.ofValue(createActionMethodArgument(paramType, action), newScopeData);
			}
			else if (methodParam.annotationType() == Out.class) {
				// parameter is annotated with *only* OUT annotation
				// create the output value now AND to save the type
				paramTarget = Target.ofMethodParam(methodParam, createActionMethodArgument(paramType, action));
			}
			else {
				// parameter is annotated with any IN annotation
				// create target with NO value, as the value will be created later
				paramTarget = Target.ofMethodParam(methodParam, type -> createActionMethodArgument(type, action));
			}

			target[i + 1] = paramTarget;
		}
		return target;
	}
protected Target [ ] makeTargets ( final Target actionTarget , final MethodParam [ ] methodParams ) { if ( methodParams == null ) { // action does not have method parameters, so there is just one target return new Target [ ] { actionTarget } ; } // action has method arguments, so there is more then one target final Target [ ] target = new Target [ methodParams . length + 1 ] ; target [ 0 ] = actionTarget ; final Object action = actionTarget . value ( ) ; for ( int i = 0 ; i < methodParams . length ; i ++ ) { final MethodParam methodParam = methodParams [ i ] ; final Class paramType = methodParam . type ( ) ; final Target paramTarget ; if ( methodParam . annotationType ( ) == null ) { // parameter is NOT annotated, create new value for the target // the class itself will be a base class, and should be scanned final ScopeData newScopeData = methodParam . scopeData ( ) . inspector ( ) . inspectClassScopesWithCache ( paramType ) ; paramTarget = Target . ofValue ( createActionMethodArgument ( paramType , action ) , newScopeData ) ; } else if ( methodParam . annotationType ( ) == Out . class ) { // parameter is annotated with *only* OUT annotation // create the output value now AND to save the type paramTarget = Target . ofMethodParam ( methodParam , createActionMethodArgument ( paramType , action ) ) ; } else { // parameter is annotated with any IN annotation // create target with NO value, as the value will be created later paramTarget = Target . ofMethodParam ( methodParam , type -> createActionMethodArgument ( type , action ) ) ; } target [ i + 1 ] = paramTarget ; } return target ; }
Joins action and parameters into one single array of Targets.
Joins action and parameters into one single array of Targets .