Skip to content

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

@dmak

Description

@dmak

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions