-
Notifications
You must be signed in to change notification settings - Fork 56
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
[MPLUGIN-426] add @Description annotation #152
base: master
Are you sure you want to change the base?
Conversation
* | ||
* @return a description of the Mojo or the parameter. | ||
*/ | ||
String content(); |
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.
Naming?
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.
With this named as value
, could annotation be used as @Description("xxx yyy")
?
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.
Yes, that was my first idea. But since it contains HTML, I thought it might be a good idea to not use "value". But then, what would value be if added later...
Can change that. Will also add tests.
mojoAnnotationContent.setDescription( javaClass.getComment() ); | ||
if ( StringUtils.isEmpty( mojoAnnotationContent.getDescription() ) ) | ||
{ | ||
mojoAnnotationContent.setDescription( javaClass.getComment() ); | ||
} | ||
|
||
DocletTag since = findInClassHierarchy( javaClass, "since" ); | ||
if ( since != null ) | ||
if ( since != null && StringUtils.isEmpty( mojoAnnotationContent.getSince() ) ) | ||
{ | ||
mojoAnnotationContent.setSince( since.getValue() ); | ||
} | ||
|
||
DocletTag deprecated = findInClassHierarchy( javaClass, "deprecated" ); | ||
if ( deprecated != null ) | ||
if ( deprecated != null && StringUtils.isEmpty( mojoAnnotationContent.getDeprecated() ) ) | ||
{ |
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.
New behaviour (compatible): Only set from javadoc annotation if not already set by Java annotation..
DescriptionAnnotationContent descriptionAnnotationContent = new DescriptionAnnotationContent(); | ||
final MojoAnnotationVisitor descriptionAnnotationVisitor = | ||
annotationVisitorMap.get( Description.class.getName() ); | ||
if ( descriptionAnnotationVisitor != null ) | ||
{ | ||
populateAnnotationContent( descriptionAnnotationContent, descriptionAnnotationVisitor ); | ||
} |
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.
@Description
is optional and thus can be null
.
Looks ok to me |
commits added as a review |
Should the new annotation contain a |
Sounds like a plan! |
ITs missing, tests missing, draft.