Community
Participate
Working Groups
The latest AJ in AJDT supports: declare @field: int A.i: -@Foo to remove annotations. The push in refactoring should be able to apply it.
Before this can be implemented, there needs to be a way of determining what has been removed. There would probably need to be some extra API on IProgramElement. I'm thinking something like: boolean IProgramElement.removesElement(); // quick check to see if this program element performs any removals String[] IProgramElement.getRemovedAnnotations(); // returns array of fully qualified annotation types that have been removed from the target Before we decide on something like this, we should also think about what kind of API would be required for augmenting and replacing annotations.
What do you call for push in of a declare @field right now, to determine what fully qualified annotations are added?
i presume it is getAnnotationType() Let's not tackle annotation augment/replace, that isn't as urgent.
API is in: boolean isAnnotationRemover() String[] getRemovedAnnotationTypes() Note: I went with the suggestion of String[] return value there, but the corresponding one for 'regular' declare @field just returns a String. The construct itself (declare @field) can take multiple annotations but I guess no-one is using that capability and doing a push in. When there is time I'll make the other one String[] too.
Actually, for PushIn, I use IProgramElement.getDetails(). This provides the entire annotation including the annotation fields. Imports are handled separately.
Thanks. For getting the API in.
Now available.