Skip to content
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

Add/implement JVar.annotate(JAnnotationUse annotation) #1677

Closed
dmak opened this issue Jan 10, 2023 · 0 comments · Fixed by #1689
Closed

Add/implement JVar.annotate(JAnnotationUse annotation) #1677

dmak opened this issue Jan 10, 2023 · 0 comments · Fixed by #1689

Comments

@dmak
Copy link

dmak commented Jan 10, 2023

Dear community,

To allow 3rd party JAXB plugins to modify the model in a proper way, I would like to ask you to implement JVar.annotate(JAnnotationUse annotation) method:

public void annotate(JAnnotationUse annotation) {
    if (annotations == null)
        annotations = new ArrayList<>();

    annotations.add(annotation);
}

Also check isAnnotated() method which is not correctly implemented: the annotation could be added and then removed hence annotations collection may be empty, so correct implementation could be:

protected boolean isAnnotated() {
    return CollectionUtils.isNotEmpty(annotations);
}

P.S. The method is supposed to be used in jaxb-xew-plugin project.

lukasj added a commit to lukasj/jaxb-ri that referenced this issue Jan 24, 2023
…tion)

Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
lukasj added a commit that referenced this issue Jan 24, 2023
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant