I was wondering if there is already a library to programmatically write a java class or method?

I am looking for libraries capable of writing new source code into existing files or extend files that already exist.