-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend @As with a provider mechanism. #215
Conversation
Obviously missing things:
@janschaefer I liked having two separate |
@janschaefer OK, you can take a look at it now. |
return annotation.value(); | ||
} | ||
|
||
String methodName = method.getName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think one can make either argument for or against having this in the DefaultAsProvider. My rationale is that this way, a user can extend from this provider and utilize this, e.g., in the spirit of the original motivation for #189:
@As( provider = ReplaceTodayProvider.class )
public SELF a_request_with_request_date_TODAY() { … }
public static class ReplaceTodayProvider extends DefaultAsProvider {
@Override
public String as( As annotation, Method method ) {
String words = super.as( annotation, method );
return String.replace( "TODAY", formatDate( new Date() ) );
}
}
@janschaefer Updated. |
9a38d8f
to
a1a8b0f
Compare
This change extends the @as annotation for step / stage methods and classes
with an AsProvider provider() method to allow a more flexible way of
customizing the result.
fixes #189