First you want to create a YML file or just use the default config and set each item and the the cost there.
Then all you have to do is get all of the first level paths using: JavaPlugin#getConfig()#getKeys(false) This will return a set of strings, which will be your list of materials. Then loop through the config and get the price for each individual material and put it in a HashMap like this:
Loop through the collection of ItemStacks you just made above and see if the set of keys contains the item's material.
Then all you have to do is get and set the price!
Code (Java):for(ItemStack item : drops)
String name = item.getType().toString();
double cost = prices.get(name);