org.jtwig.reflection.resolver.argument.InputArgumentResolver Maven / Gradle / Ivy
package org.jtwig.reflection.resolver.argument;
import com.google.common.base.Optional;
import org.jtwig.reflection.input.InputParameterResolverContext;
import org.jtwig.reflection.model.Value;
import org.jtwig.reflection.model.java.JavaMethodArgument;
public class InputArgumentResolver implements ArgumentResolver {
private final InputArgumentValueResolver resolver;
private final InputParameterResolverContext context;
public InputArgumentResolver(InputArgumentValueResolver resolver,
InputParameterResolverContext context) {
this.resolver = resolver;
this.context = context;
}
@Override
public Optional resolve(final JavaMethodArgument methodArgument) {
InputParameterResolverContext clonedContext = context.clone();
Optional result = resolver.resolve(methodArgument, clonedContext);
if (result.isPresent()) {
context.merge(clonedContext);
}
return result;
}
public boolean isFullyResolved () {
return context.fullyUsed();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy