if (!definedNames.add(name)) {
reportErrorForNameToken(nameToken, PolymerCode.DUPLICATE_ATTRIBUTE_DEFINITION, name);
continue;
}
// create attribute
PolymerAttributeElementImpl attribute = new PolymerAttributeElementImpl(name, offset);
attributes.add(attribute);
// resolve field
FieldElement field = classElement.getField(name);
if (field == null) {
reportErrorForNameToken(
nameToken,
PolymerCode.UNDEFINED_ATTRIBUTE_FIELD,
name,
classElement.getDisplayName());
continue;
}
if (!isPublishedField(field)) {
reportErrorForNameToken(
nameToken,
PolymerCode.ATTRIBUTE_FIELD_NOT_PUBLISHED,
name,
classElement.getDisplayName());
}
attribute.setField(field);
}
htmlElement.setAttributes(attributes.toArray(new PolymerAttributeElement[attributes.size()]));
}