Have you taken a look at the code in your editor for other gen structures? Specifically in net.minecraft.village. This line caught my eye, not sure if it's really what your looking for.
Have a look through that class, there should be some loot-generation code along the lines of what you're looking for.