@SuppressWarnings("unchecked") protected void readAttributes(DOMInput in) throws IOException { if (in.getElementCount("a") > 0) { in.openElement("a"); for (int i=in.getElementCount() - 1; i >= 0; i-- ) { in.openElement(i); String name = in.getTagName(); Object value = in.readObject(); AttributeKey key = getAttributeKey(name); if (key != null && key.isAssignable(value)) { if (forbiddenAttributes == null || ! forbiddenAttributes.contains(key)) { set(key, value); } } in.closeElement(); } in.closeElement(); } }