'meaning of @P annotation in spring-boot

I have a simple and maybe stupid question so apologies in advance..

I have been reading some spring-boot java code recently I am able to understand almost all for I have been able to find documentation everywhere.. but for example for this I still can't figure out the exact meaning (I am not able to find the annotation @P):

public MyFileEvent getEvent(
        @P("user") User user,
        @P("file") @Valid @RequestBody EventFile file) throws MyException {

    return myService.getFileEvent(file);
}

I understand @Valid and @RequestBody but I don't find the meaning of @P.



Solution 1:[1]

According to the javadoc:

"An annotation that can be used along with AnnotationParameterNameDiscoverer to specify parameter names. This is useful for interfaces prior to JDK 8 which cannot contain the parameter names."

There are in fact two versions of the @P annotation:

  • org.springframework.security.access.method.P since Spring 3.2 (deprecated)
  • org.springframework.security.core.parameters.P since Spring 5.0

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1