for (Attribute attribute : attributes.values()) {
String name = attribute.getName();
AttributeDef attributeDef = def.getAttributeDef(name);
if (attributeDef == null) {
throw new AttributeNotFoundException(rootDefDescriptor, name, def.getLocation());
}
if (attributeDef.getSerializeTo() == AttributeDef.SerializeToType.BOTH) {
TypeDef typeDef = attributeDef.getTypeDef();
if ((valueProvider == null && !((typeDef instanceof ComponentArrayTypeDef) || (typeDef instanceof ComponentTypeDef)))