I have an ASTVisitor-implementing class with (among others) this method:
@Override
public boolean visit(final ImportDeclaration node) {...}
Is there any way to find out whether the ImportDeclaration is from another package of the project which the ASTVisitor is going through or if it's from a .jar = library-content?
I tried node.resolveBinding().isSynthetic(), but it seems never to be synthetic despite me having imports from a library.
Ok, the solution is resolving the node to IBinding and then ITypeBinding and calling isFromSource():