/**
* Joins action and parameters into one array of Targets.
*/
protected Target[] makeTargets() {
if (actionConfig.hasArguments == false) {
return new Target[] {new Target(action)};
}
ActionConfig.MethodParam[] methodParams = actionConfig.getMethodParams();
Target[] target = new Target[methodParams.length + 1];
target[0] = new Target(action);
for (int i = 0; i < methodParams.length; i++) {
ActionConfig.MethodParam mp = methodParams[i];
Class type = mp.getType();
Target t;
if (mp.getAnnotationType() == null) {
// parameter is NOT annotated
t = new Target(createActionMethodArgument(type));
}
else if (mp.getAnnotationType() == Out.class) {
// parameter is annotated with *only* OUT annotation
// we need to create the output AND to save the type
t = new Target(createActionMethodArgument(type), type);
}
else {
// parameter is annotated with any IN annotation
t = new Target(type) {
@Override
protected void createValueInstance() {
value = createActionMethodArgument(type);
}
};