I am using HashSet which has some attributes used for all elements and then adding this Hashset to a HashMap corresponding for each element. Additionally few attributes are added for specific elements( ex THEAD ).
But the later added attribute align is present for both Table and THEAD. Is there something wrong in the below code.
private static HashMap<String, Set<String>> ELEMENT_ATTRIBUTE_MAP =
new HashMap<String, Set<String>>();
HashSet<String> tableSet =
new HashSet<String>(Arrays.asList(new String[]
{HTMLAttributeName.style.toString(),
HTMLAttributeName.color.toString(),
HTMLAttributeName.dir.toString(),
HTMLAttributeName.bgColor.toString()}));
ELEMENT_ATTRIBUTE_MAP.put(HTMLElementName.TABLE, new HashSet<String>(tableSet));
// Add align only for Head
tableSet.add(HTMLAttributeName.align.toString());
ELEMENT_ATTRIBUTE_MAP.put(HTMLElementName.THEAD, tableSet);