Invalid JavaCore IType Caching Problem

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 {
  // Some changes here...
}

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()) {
        // The annotation does not exist, so add the type to the
        // list of elements to update and go on...
        ret.add(type);
        continue;
      }
 // Something else here...
    }

, , , , IType , , . , .

, triple , , IType, ( IType java- , ).

, , ? , API JavaCore, , , , , eclipse IType , : -/

- , : -)

+5
1

? - ? , " " IType, . , .

0

All Articles