I would hazard a guess that if Blizzard has item tooltips showing specific spec requirements there may be a value on the GetItemInfo function's return values that offer that number. Maybe even a class value, if you are lucky. And hopefully primary stat, secondary stat etc info and that it is identifiable.
Short of that, the table info list idea might be the way to go ..
Create a table of class-armor combos and class-stat combos and check to see if the values match the item info when looking at an item .. if it passes the tests its a valid item.
Thats how I would do it anyway