I am using custom annotation with aspectj.
@TestLoggingAnnotation(setMessage = "I want to set value here")
public void get() {
String retString = null;
String message = "DEFAULT";
if (message == "DEFAULT") {
retString = "Default Logging";
} else {
retString = "Custom Logging";
}
}
The above is just simple and sample code. My requirement is that I want to pass the parameter value after resulting from method.
In my case I want set retString
value to setMessage
in custom parameter.
As of now, annotations can only take compile constants and cant be assigned values at runtime, though their value can be used at runtime using @Retention.
discussion follows here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With