Yes, whether Spring can do it or not doesn't really matter much, because source-codes even in the same language, I'm sure are created and linked differently all the time(for different outcomes of course). And besides the piece of code you want has roots all over the place in other parts of the source code, where it gets linked with stuff it needs, and to command structures and stuff, so it can be used.
You simply cannot transplant parts of a program, the same way that you can't chop off an arm and glue it on someone else, and then expect it to work.