Runtime alternative for @JavaScript

Is there a way to call some kind of method that does the same as the @JavaScript annotation? The thing is that at runtime I want to create a Vaadin component and tell this instance to load some script like the annotation would do.