I have recently bumped into the same issue myself.
I haven't found any quick fix for it, but implementing it was easy. You could implement your own Visitor which will traverse the AST and throws an execption in case it encounters a node it dislikes.
Such nodes might be import nodes for example from undesired packages. Other nodes might be illegal constructor calls or illegal static method activations. You should research the AST a bit, but in a few days you will achieve nice functionality.
hope it helped...
Yahoo! DSL Something to write home about. Just $16.99/mo. or less