DATACMNS-731 - Parameter now exposes whether it's named explicitly.

Parameter now has a isExplicitlyNamed() to indicate whether the user explicitly assigned a name to it in contrast to an implicitly discovered parameter name.
This commit is contained in:
Oliver Gierke
2015-07-15 16:18:37 +02:00
parent cd6b2c09c6
commit 174e9a6e93
2 changed files with 40 additions and 2 deletions

View File

@@ -121,6 +121,16 @@ public class Parameter {
return parameter.getParameterType();
}
/**
* Returns whether the parameter is named explicitly, i.e. annotated with {@link Param}.
*
* @return
* @since 1.11
*/
public boolean isExplicitlyNamed() {
return parameter.hasParameterAnnotation(Param.class);
}
/*
* (non-Javadoc)
* @see java.lang.Object#toString()