I am developing a plugin that accepts all enums in a workspace that implements a certain interface (IDomain), analyzes the code (using AST), makes some modification on the enumeration and marks it as processed by the annotation (@IDomainInfo).
For example, this requires the following:
public
enum SomeEnum implements IDomain {
}
And generates something like this:
public @IDomainInfo(domainId = 1)
enum SomeEnum implements IDomain {
}
The idea of ββ@IDomainInfo is that processed annotated enumerations are no longer processed by the plugin.
, , API JavaSearch, , IDomain ( ), IJavaElements ( IType). , IType, @IDomainInfo, : IType , IType @ IDomainInfo ( AST), ( IFile, , , enum open , , : -)
, , @IDomainInfo ( ), @IDomainInfo, ( ), , , , , IType , :
for (IType type : typeList) {
IAnnotation annotation = type.getAnnotation("IDomainInfo");
if (!annotation.exists()) {
ret.add(type);
continue;
}
}
, , , , IType , , . , .
, triple , , IType, ( IType java- , ).
, , ? , API JavaCore, , , , , eclipse IType , : -/
- , : -)