Class ModelsParameterResolver

java.lang.Object
fr.paris.lutece.portal.util.mvc.binding.ModelsParameterResolver
All Implemented Interfaces:
ParameterResolver

@ApplicationScoped public class ModelsParameterResolver extends Object implements ParameterResolver
This class resolves parameters of type Models in the context of a web request. It is used to inject a Models instance into methods annotated with MVC annotations.

The ModelsParameterResolver is responsible for providing an instance of Models when requested, allowing for easy access to model data in MVC applications.

  • Constructor Details

    • ModelsParameterResolver

      @Inject public ModelsParameterResolver(jakarta.enterprise.inject.Instance<Models> modelInstance)
      Constructor for ModelsParameterResolver.
      Parameters:
      modelInstance - the instance of Models to be injected
  • Method Details

    • supports

      public boolean supports(Parameter parameter)
      Checks if the resolver can handle the given parameter.
      Specified by:
      supports in interface ParameterResolver
      Parameters:
      parameter - the parameter to check
      Returns:
      true if the resolver can handle the parameter, false otherwise
    • resolve

      public ResolverResult<Models> resolve(jakarta.servlet.http.HttpServletRequest request, Parameter parameter)
      Resolves and converts the given parameter from the HTTP request.
      Specified by:
      resolve in interface ParameterResolver
      Parameters:
      request - the HTTP request
      parameter - the parameter to resolve
      Returns:
      the result of the resolution and conversion